Fix: test; limit changes on player update

This commit is contained in:
Grail Finder
2025-07-04 10:02:39 +03:00
parent 6ca8afd13d
commit 83215f5c14
9 changed files with 40 additions and 92 deletions

View File

@ -38,11 +38,12 @@ CREATE TABLE word_cards (
);
CREATE TABLE card_marks (
id INTEGER PRIMARY KEY AUTOINCREMENT,
card_id INTEGER NOT NULL,
username TEXT NOT NULL,
active BOOLEAN NOT NULL DEFAULT TRUE,
FOREIGN KEY (card_id) REFERENCES word_cards(id) ON DELETE CASCADE
FOREIGN KEY (card_id) REFERENCES word_cards(id) ON DELETE CASCADE,
FOREIGN KEY (username) REFERENCES players(username) ON DELETE CASCADE,
PRIMARY KEY (card_id, username)
);
CREATE TABLE actions (
@ -75,4 +76,4 @@ CREATE TABLE sessions(
token_key TEXT NOT NULL DEFAULT '' UNIQUE, -- encoded value
username TEXT NOT NULL,
FOREIGN KEY (username) REFERENCES players(username) ON DELETE CASCADE
);
);