PATCH: Fix to Database Changes

This commit is contained in:
Chris-1010
2025-01-28 15:14:33 +00:00
parent 13d7351588
commit 25235c5c26
7 changed files with 56 additions and 62 deletions

View File

@@ -38,15 +38,14 @@ CREATE TABLE categories
DROP TABLE IF EXISTS streams;
CREATE TABLE streams
(
stream_id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL,
stream_id INTEGER NOT NULL,
title TEXT NOT NULL,
start_time DATETIME NOT NULL,
num_viewers INTEGER NOT NULL DEFAULT 0,
isLive BOOLEAN NOT NULL DEFAULT 0,
vod_id INTEGER,
category_id NOT NULL,
PRIMARY KEY (user_id, stream_id),
FOREIGN KEY (category_id) REFERENCES categories(category_id) ON DELETE CASCADE,
FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE
);