Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invites_table.go should probably CREATE SEQUENCE IF NOT EXISTS syncapi_stream_id #723

Closed
matrixbot opened this issue Oct 31, 2024 · 3 comments

Comments

@matrixbot
Copy link
Collaborator

This issue was originally created by @Cnly at matrix-org/dendrite#723.

It looks like invites_table.go should also have the CREATE SEQUENCE line as in other data tables sharing syncapi_stream_id e.g. https://github.com/matrix-org/dendrite/blob/master/syncapi/storage/account_data_table.go#L28.

@matrixbot
Copy link
Collaborator Author

This comment was originally posted by @neilalexander at matrix-org/dendrite#723 (comment).

The syncapi_stream_id sequence will already exist due to one of the other two statements which create it (which is probably already one too many):

$ 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;

I'm not sure if there is any benefit in adding another statement which will end up being ignored due to the sequence already existing.

@matrixbot
Copy link
Collaborator Author

This comment was originally posted by @kegsay at matrix-org/dendrite#723 (comment).

Having the clarity that is depends on the sequence existing could be nice, though a pain if we ever want to update it.

@matrixbot
Copy link
Collaborator Author

This comment was originally posted by @kegsay at matrix-org/dendrite#723 (comment).

Negated by matrix-org/dendrite#963

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

No branches or pull requests

1 participant