2024-12-01 04:03:52 +00:00
|
|
|
CREATE TABLE users(
|
|
|
|
uuid TEXT PRIMARY KEY,
|
2024-12-27 19:02:43 +00:00
|
|
|
name TEXT UNIQUE,
|
2024-12-01 04:03:52 +00:00
|
|
|
password TEXT,
|
|
|
|
admin BOOLEAN,
|
|
|
|
enabled BOOLEAN
|
|
|
|
);
|
|
|
|
|
2024-12-27 19:02:43 +00:00
|
|
|
CREATE TABLE sessions(
|
|
|
|
id TEXT PRIMARY KEY,
|
|
|
|
user_id TEXT,
|
|
|
|
|
|
|
|
FOREIGN KEY(user_id) REFERENCES users(uuid)
|
|
|
|
);
|
|
|
|
|
2024-12-16 05:27:55 +00:00
|
|
|
CREATE TABLE games(
|
|
|
|
uuid TEXT PRIMARY KEY,
|
2025-01-02 16:57:17 +00:00
|
|
|
gm TEXT,
|
|
|
|
game_type TEXT,
|
|
|
|
name TEXT,
|
|
|
|
|
|
|
|
FOREIGN KEY(gm) REFERENCES users(uuid)
|
2024-12-16 05:27:55 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE characters(
|
|
|
|
uuid TEXT PRIMARY KEY,
|
|
|
|
game TEXT,
|
|
|
|
data TEXT,
|
|
|
|
|
|
|
|
FOREIGN KEY(game) REFERENCES games(uuid)
|
|
|
|
);
|
|
|
|
|
2024-12-01 04:03:52 +00:00
|
|
|
CREATE TABLE roles(
|
|
|
|
user_id TEXT,
|
|
|
|
game_id TEXT,
|
|
|
|
role TEXT,
|
|
|
|
|
|
|
|
FOREIGN KEY(user_id) REFERENCES users(uuid),
|
|
|
|
FOREIGN KEY(game_id) REFERENCES games(uuid)
|
|
|
|
);
|
2024-12-16 05:27:55 +00:00
|
|
|
|
2024-12-31 17:56:05 +00:00
|
|
|
INSERT INTO users VALUES ('admin', 'admin', '', true, true);
|