From 601ce32ee8d0cee32b66c87b0bfefa7424a5b8c8 Mon Sep 17 00:00:00 2001
From: fusion32 <marcopuzziello@gmail.com>
Date: Sat, 18 Oct 2025 02:32:59 -0300
Subject: modify how automatic SQLite patches/upgrades works + overall cleanup

---
 sqlite/z-001-migrate-v01-to-v02.sql | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 sqlite/z-001-migrate-v01-to-v02.sql

(limited to 'sqlite/z-001-migrate-v01-to-v02.sql')

diff --git a/sqlite/z-001-migrate-v01-to-v02.sql b/sqlite/z-001-migrate-v01-to-v02.sql
new file mode 100644
index 0000000..b7df053
--- /dev/null
+++ b/sqlite/z-001-migrate-v01-to-v02.sql
@@ -0,0 +1,14 @@
+-- NOTE(fusion): This file contains the migration script from v0.1 to v0.2. It
+-- can be placed into `patches/` to upgrade an existing database. Note that these
+-- changes are already present in the latest `schema.sql`, so trying to patch a
+-- newly created database will probably result in errors. See `sqlite/README.txt`
+-- for more details.
+--==============================================================================
+
+ALTER TABLE Worlds          RENAME COLUMN OnlineRecord          TO OnlinePeak;
+ALTER TABLE Worlds          RENAME COLUMN OnlineRecordTimestamp TO OnlinePeakTimestamp;
+ALTER TABLE CharacterRights RENAME COLUMN Right                 TO Name;
+
+ALTER TABLE Worlds          ADD COLUMN LastStartup INTEGER NOT NULL DEFAULT 0;
+ALTER TABLE Worlds          ADD COLUMN LastShutdown INTEGER NOT NULL DEFAULT 0;
+
-- 
cgit v1.2.3

