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.
15 lines
531 B
MySQL
15 lines
531 B
MySQL
|
2 months ago
|
CREATE TABLE IF NOT EXISTS room_settings (
|
||
|
|
room_id BIGINT NOT NULL REFERENCES rooms(id) ON DELETE RESTRICT,
|
||
|
|
settings JSONB NOT NULL,
|
||
|
|
version BIGINT NOT NULL DEFAULT 0,
|
||
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||
|
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||
|
|
PRIMARY KEY (room_id),
|
||
|
|
CHECK (jsonb_typeof(settings) = 'object')
|
||
|
|
);
|
||
|
|
|
||
|
|
CREATE TRIGGER update_room_settings_updated_at
|
||
|
|
BEFORE UPDATE ON room_settings
|
||
|
|
FOR EACH ROW
|
||
|
|
EXECUTE FUNCTION update_updated_at_column();
|