From d26ac746d42f54af4dffdc1c4d7da05318cd9584 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Wed, 31 Jul 2024 18:40:23 -0500 Subject: [PATCH] Start thinking about schemas --- .../delta/87/01_sliding_sync_memberships.sql | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 synapse/storage/schema/main/delta/87/01_sliding_sync_memberships.sql diff --git a/synapse/storage/schema/main/delta/87/01_sliding_sync_memberships.sql b/synapse/storage/schema/main/delta/87/01_sliding_sync_memberships.sql new file mode 100644 index 0000000000..cd211bad92 --- /dev/null +++ b/synapse/storage/schema/main/delta/87/01_sliding_sync_memberships.sql @@ -0,0 +1,35 @@ +-- +-- This file is licensed under the Affero General Public License (AGPL) version 3. +-- +-- Copyright (C) 2024 New Vector, Ltd +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU Affero General Public License as +-- published by the Free Software Foundation, either version 3 of the +-- License, or (at your option) any later version. +-- +-- See the GNU Affero General Public License for more details: +-- . + +CREATE TABLE IF NOT EXISTS sliding_sync_joined_rooms( + room_id TEXT NOT NULL REFERENCES rooms(room_id), + room_type TEXT, + room_name TEXT, + is_encrypted BOOLEAN, + stream_ordering: BIGINT, + bump_stamp: BIGINT, +); + +CREATE UNIQUE INDEX IF NOT EXISTS sliding_sync_joined_rooms_room_id ON sliding_sync_joined_rooms(room_id); + +CREATE TABLE IF NOT EXISTS sliding_sync_non_join_memberships( + membership_event_id TEXT NOT NULL REFERENCES events(event_id), + room_id TEXT NOT NULL REFERENCES rooms(room_id), + room_type TEXT, + room_name TEXT, + is_encrypted BOOLEAN, + stream_ordering: BIGINT, + bump_stamp: BIGINT, +); + +CREATE UNIQUE INDEX IF NOT EXISTS sliding_sync_non_join_memberships_membership_event_id ON sliding_sync_non_join_memberships(membership_event_id);