From dbb714e6c9a9171130ad8fc65e350fe3736048a0 Mon Sep 17 00:00:00 2001 From: Pushpam Choudhary Date: Tue, 3 Dec 2019 22:33:02 +0530 Subject: [PATCH] Add CREATE SEQUENCE line in invites_table.go --- go.mod | 2 ++ syncapi/storage/invites_table.go | 3 +++ 2 files changed, 5 insertions(+) diff --git a/go.mod b/go.mod index d51f0a33e..4eedbbbac 100644 --- a/go.mod +++ b/go.mod @@ -65,3 +65,5 @@ require ( gopkg.in/macaroon.v2 v2.1.0 gopkg.in/yaml.v2 v2.2.2 ) + +go 1.13 diff --git a/syncapi/storage/invites_table.go b/syncapi/storage/invites_table.go index 9f52087f6..b90b1f383 100644 --- a/syncapi/storage/invites_table.go +++ b/syncapi/storage/invites_table.go @@ -9,6 +9,9 @@ import ( ) const inviteEventsSchema = ` +-- This sequence is shared between all the tables generated from kafka logs. +CREATE SEQUENCE IF NOT EXISTS syncapi_stream_id; + CREATE TABLE IF NOT EXISTS syncapi_invite_events ( id BIGINT PRIMARY KEY DEFAULT nextval('syncapi_stream_id'), event_id TEXT NOT NULL,