Feat: session table and interface
This commit is contained in:
@ -20,7 +20,7 @@ CREATE TABLE rooms (
|
||||
CREATE TABLE players (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
room_id TEXT, -- nullable
|
||||
username TEXT NOT NULL,
|
||||
username TEXT NOT NULL UNIQUE,
|
||||
team TEXT NOT NULL DEFAULT '', -- 'red' or 'blue'
|
||||
role TEXT NOT NULL DEFAULT '', -- 'guesser' or 'mime'
|
||||
is_bot BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
@ -67,3 +67,12 @@ CREATE TABLE settings (
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (room_id) REFERENCES rooms(id)
|
||||
);
|
||||
|
||||
CREATE TABLE sessions(
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
lifetime INTEGER NOT NULL DEFAULT 3600,
|
||||
cookie_token TEXT NOT NULL DEFAULT '', -- encoded value
|
||||
username TEXT NOT NULL,
|
||||
FOREIGN KEY (username) REFERENCES players(username)
|
||||
);
|
||||
|
Reference in New Issue
Block a user