Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Add create sequence in invites_table.go in syncapi #857

Closed
wants to merge 1 commit into from

Conversation

PC25
Copy link

@PC25 PC25 commented Jan 26, 2020

Fixes #723
Signed-off-by: Pushpam [email protected]

@PC25 PC25 requested a review from Cnly January 26, 2020 20:05
Copy link
Contributor

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these sequences are scoped to the database and not to the table, is it not unnecessary to add another CREATE SEQUENCE IF NOT EXISTS line since it will be practically ignored anyway?

$ git grep syncapi_stream_id | grep CREATE
syncapi/storage/postgres/account_data_table.go:CREATE SEQUENCE IF NOT EXISTS syncapi_stream_id;
syncapi/storage/postgres/output_room_events_table.go:CREATE SEQUENCE IF NOT EXISTS syncapi_stream_id;

@kegsay
Copy link
Member

kegsay commented Apr 14, 2020

Yes, but for documentation purposes it is nice to see what that mysterious sequence is. It doesn't have to be done on a per-table basis, but we don't really have anywhere to put DB-level SQL statements.

I'm going to make an executive decision and say that we should probably have a place for DB-level SQL statements (the file which implements the storage interface), rather than dupe this everywhere and have it be a pain to update later. This makes this issue null and void, and #963 A Thing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

invites_table.go should probably CREATE SEQUENCE IF NOT EXISTS syncapi_stream_id
3 participants