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

@@ -22,7 +22,7 @@ CREATE TABLE follows
user_id INTEGER NOT NULL,
followed_id INTEGER NOT NULL,
since DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (user_id, streamer_id),
PRIMARY KEY (user_id, followed_id),
FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE,
FOREIGN KEY (followed_id) REFERENCES users(user_id) ON DELETE CASCADE
);
@@ -45,7 +45,7 @@ CREATE TABLE subscribes
subscribed_id INTEGER NOT NULL,
since DATETIME NOT NULL,
expires DATETIME NOT NULL,
PRIMARY KEY (user_id,streamer_id),
PRIMARY KEY (user_id),
FOREIGN KEY(user_id) REFERENCES users(user_id) ON DELETE CASCADE,
FOREIGN KEY(subscribed_id) REFERENCES users(user_id) ON DELETE CASCADE
);