feat: add Stream table & boilerplate

This commit is contained in:
2026-05-03 12:51:32 +01:00
parent 942f0d1a77
commit 265a96acc1
7 changed files with 88 additions and 2 deletions

View File

@@ -9,8 +9,20 @@ CREATE TABLE IF NOT EXISTS users (
name VARCHAR(100) NOT NULL,
profile_picture_url VARCHAR(255),
role INTEGER DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
stream_key VARCHAR(64) NOT NULL
);
CREATE TABLE IF NOT EXISTS streams (
id BIGSERIAL PRIMARY KEY,
user_id BIGSERIAL,
start_time TIMESTAMPTZ DEFAULT NOW(),
end_time TIMESTAMPTZ DEFAULT NULL,
last_seen TIMESTAMPTZ DEFAULT NULL
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
)
CREATE TABLE IF NOT EXISTS clips (
id BIGSERIAL PRIMARY KEY,