chore: integrate multiplayer code (wip)
This commit is contained in:
parent
2838d59f30
commit
4f5e21becb
66 changed files with 6423 additions and 18 deletions
24
server/relay-server/migrations/001_init.sql
Normal file
24
server/relay-server/migrations/001_init.sql
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
CREATE TABLE IF NOT EXISTS users (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
username TEXT NOT NULL UNIQUE,
|
||||
email TEXT NOT NULL UNIQUE,
|
||||
password_hash TEXT NOT NULL,
|
||||
created_at INTEGER NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS game_records (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
game_id TEXT NOT NULL,
|
||||
room_code TEXT NOT NULL,
|
||||
started_at INTEGER NOT NULL,
|
||||
ended_at INTEGER,
|
||||
result TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS game_participants (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
game_record_id INTEGER NOT NULL REFERENCES game_records(id),
|
||||
user_id INTEGER REFERENCES users(id),
|
||||
player_id INTEGER NOT NULL,
|
||||
outcome TEXT
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue