Update backend_database_specification.md

This commit is contained in:
Stephen Seo 2022-03-21 13:25:32 +09:00
parent 6c47ce948b
commit 20a8b6ade0

View file

@ -24,13 +24,13 @@ CREATE TABLE players (id INTEGER PRIMARY KEY NOT NULL,
// "3" for magenta won, "4" for draw.
CREATE TABLE games (id INTEGER PRIMARY KEY NOT NULL,
cyan_player INTEGER UNIQUE NOT NULL,
magenta_player INTEGER UNIQUE NOT NULL,
cyan_player INTEGER UNIQUE,
magenta_player INTEGER UNIQUE,
date_changed TEXT NOT NULL,
board TEXT NOT NULL,
status INTEGER NOT NULL,
FOREIGN KEY(cyan_player) REFERENCES players (id),
FOREIGN KEY(magenta_player) REFERENCES players (id));
FOREIGN KEY(cyan_player) REFERENCES players (id) ON DELETE SET NULL,
FOREIGN KEY(magenta_player) REFERENCES players (id) ON DELETE SET NULL);
```
"date" entries are used for garbage collection of the database. A predefined