Start thinking about schemas

This commit is contained in:
Eric Eastwood
2024-07-31 18:40:23 -05:00
parent 2b620e0a15
commit d26ac746d4
@@ -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:
-- <https://www.gnu.org/licenses/agpl-3.0.html>.
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);