mirror of https://github.com/synctv-org/synctv
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
477 B
SQL
12 lines
477 B
SQL
CREATE TABLE IF NOT EXISTS room_member_versions (
|
|
room_id BIGINT NOT NULL REFERENCES rooms(id) ON DELETE CASCADE,
|
|
user_id BIGINT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
version BIGINT NOT NULL DEFAULT 0,
|
|
is_member BOOLEAN NOT NULL DEFAULT FALSE,
|
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
PRIMARY KEY (room_id, user_id)
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_room_member_versions_user
|
|
ON room_member_versions(user_id, room_id);
|