Fix: on login add player once

This commit is contained in:
Grail Finder
2025-07-11 09:03:18 +03:00
parent d056c4a07e
commit 37fe76456e
7 changed files with 30 additions and 34 deletions

View File

@ -90,7 +90,7 @@ CREATE TABLE journal(
CREATE TABLE player_stats (
id INTEGER PRIMARY KEY AUTOINCREMENT,
player_username TEXT NOT NULL UNIQUE,
username TEXT NOT NULL UNIQUE,
games_played INTEGER NOT NULL DEFAULT 0,
games_won INTEGER NOT NULL DEFAULT 0,
games_lost INTEGER NOT NULL DEFAULT 0,
@ -101,6 +101,6 @@ CREATE TABLE player_stats (
guesser_winrate REAL NOT NULL DEFAULT 0.0,
played_as_mime INTEGER NOT NULL DEFAULT 0,
played_as_guesser INTEGER NOT NULL DEFAULT 0,
FOREIGN KEY (player_username) REFERENCES players(username) ON DELETE CASCADE
FOREIGN KEY (username) REFERENCES players(username) ON DELETE CASCADE
);