aboutsummaryrefslogtreecommitdiff
path: root/sql/schema.sql
diff options
context:
space:
mode:
authorfusion32 <marcopuzziello@gmail.com>2025-08-01 19:23:13 -0300
committerfusion32 <marcopuzziello@gmail.com>2025-08-01 19:23:13 -0300
commit634554a0df8dfd35630f17b5fee44c54b7af73a5 (patch)
tree752503318c639afd205e72ba88c16c87d5f3e298 /sql/schema.sql
parent82b82dca7d621bf4530416c7c5e9fc69874eecd3 (diff)
downloadquerymanager-634554a0df8dfd35630f17b5fee44c54b7af73a5.tar.gz
querymanager-634554a0df8dfd35630f17b5fee44c54b7af73a5.zip
fix problem with concurrent writes + implement website queries
There was a problem with concurrent writes not being visible until after restart, due to how cached prepared statements work with SQLite (see comment in `database.cc`).
Diffstat (limited to 'sql/schema.sql')
-rw-r--r--sql/schema.sql14
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/schema.sql b/sql/schema.sql
index c8a78ec..90f59a8 100644
--- a/sql/schema.sql
+++ b/sql/schema.sql
@@ -6,12 +6,16 @@ CREATE TABLE IF NOT EXISTS Worlds (
Type INTEGER NOT NULL,
RebootTime INTEGER NOT NULL,
IPAddress INTEGER NOT NULL,
+ -- TODO(fusion): Have some hostname resolution cache and send the resolved
+ -- addresses instead of hardcoding them into the database.
+ --Host TEXT NOT NULL,
Port INTEGER NOT NULL,
MaxPlayers INTEGER NOT NULL,
PremiumPlayerBuffer INTEGER NOT NULL,
MaxNewbies INTEGER NOT NULL,
PremiumNewbieBuffer INTEGER NOT NULL,
OnlineRecord INTEGER NOT NULL DEFAULT 0,
+ OnlineRecordTimestamp INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (WorldID),
UNIQUE (Name)
);
@@ -275,6 +279,16 @@ INSERT INTO Accounts (AccountID, Email, Auth)
INSERT INTO Characters (WorldID, CharacterID, AccountID, Name, Sex)
VALUES (1, 1, 111111, 'Gamemaster', 1), (1, 2, 111111, 'Player', 1);
+/*
+-- TODO(fusion): Have group rights instead of adding individual rights to characters?
+ALTER TABLE Characters ADD GroupID INTEGER NOT NULL;
+CREATE TABLE IF NOT EXISTS CharacterRights (
+ GroupID INTEGER NOT NULL,
+ Right TEXT NOT NULL COLLATE NOCASE,
+ PRIMARY KEY(GroupID, Right)
+);
+*/
+
INSERT INTO CharacterRights (CharacterID, Right)
VALUES
(1, 'NOTATION'),