From 013958716b1b7175d46eddffb1f5c7235c81b50a Mon Sep 17 00:00:00 2001 From: Mathieu Velten Date: Mon, 12 Sep 2022 12:30:38 +0200 Subject: [PATCH] Use setval as in the rest of the code --- .../schema/main/delta/58/05cache_instance.sql.postgres | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/synapse/storage/schema/main/delta/58/05cache_instance.sql.postgres b/synapse/storage/schema/main/delta/58/05cache_instance.sql.postgres index 4b1399277727..947d0201fc11 100644 --- a/synapse/storage/schema/main/delta/58/05cache_instance.sql.postgres +++ b/synapse/storage/schema/main/delta/58/05cache_instance.sql.postgres @@ -27,7 +27,9 @@ CREATE TABLE cache_invalidation_stream_by_instance ( CREATE UNIQUE INDEX cache_invalidation_stream_by_instance_id ON cache_invalidation_stream_by_instance(stream_id); +CREATE SEQUENCE cache_invalidation_stream_seq; + -- The sequence needs to begin at 2 because a bunch of code assumes that -- get_next_id_txn will return values >= 2, cf this comment: -- https://github.com/matrix-org/synapse/blob/b93bd95e8ab64d27ae26841020f62ee61272a5f2/synapse/storage/util/id_generators.py#L344 -CREATE SEQUENCE cache_invalidation_stream_seq MINVALUE 2; +SELECT setval('cache_invalidation_stream_seq', 1);