aboutsummaryrefslogtreecommitdiff
path: root/postgres/schema.sql
diff options
context:
space:
mode:
authorfusion32 <marcopuzziello@gmail.com>2025-10-18 02:32:59 -0300
committerfusion32 <marcopuzziello@gmail.com>2025-10-18 02:35:24 -0300
commit601ce32ee8d0cee32b66c87b0bfefa7424a5b8c8 (patch)
tree7b06c2d9d385b957377b801b83f004fc554e19d0 /postgres/schema.sql
parentd92f642810dc3125515d64f953d2bee840de1cc1 (diff)
downloadquerymanager-601ce32ee8d0cee32b66c87b0bfefa7424a5b8c8.tar.gz
querymanager-601ce32ee8d0cee32b66c87b0bfefa7424a5b8c8.zip
modify how automatic SQLite patches/upgrades works + overall cleanup
Diffstat (limited to 'postgres/schema.sql')
-rw-r--r--postgres/schema.sql24
1 files changed, 11 insertions, 13 deletions
diff --git a/postgres/schema.sql b/postgres/schema.sql
index 32afe2c..efe9133 100644
--- a/postgres/schema.sql
+++ b/postgres/schema.sql
@@ -29,6 +29,17 @@ CREATE COLLATION NOCASE (
-- using them here. It might be a good idea for consistency, but it's not a hard
-- requirement.
+-- NOTE(fusion): A table with schema information. It currently only contains the
+-- schema version which is checked at startup against `POSTGRESQL_SCHEMA_VERSION`,
+-- defined in `database_postgres.cc`. The query manager will only startup if the
+-- versions match.
+CREATE TABLE SchemaInfo (
+ Key TEXT NOT NULL COLLATE NOCASE,
+ Value TEXT NOT NULL,
+ PRIMARY KEY (Key)
+);
+INSERT INTO SchemaInfo (Key, Value) VALUES ('VERSION', '1');
+
-- Primary Tables
--==============================================================================
CREATE TABLE Worlds (
@@ -280,17 +291,4 @@ CREATE TABLE OnlineCharacters (
PRIMARY KEY (WorldID, Name)
);
--- Schema Info
---==============================================================================
--- NOTE(fusion): The `SchemaInfo` table should hold information about the schema
--- and be used for consistency checks at startup. It currently only contains the
--- schema version, which I feel is the only value needed.
-CREATE TABLE SchemaInfo (
- Key TEXT NOT NULL COLLATE NOCASE,
- Value TEXT NOT NULL,
- PRIMARY KEY (Key)
-);
-
-INSERT INTO SchemaInfo (Key, Value) VALUES ('VERSION', '1');
-
COMMIT;