Fix settings migration order for current ingame time columns

This commit is contained in:
Kai
2026-02-16 12:55:25 +01:00
parent 5528d3e688
commit 8b540fb918

View File

@@ -13,9 +13,11 @@ func ensureSchema(db *sql.DB) error {
current_month TINYINT NOT NULL DEFAULT 1,
current_day TINYINT NOT NULL DEFAULT 1
)`,
`INSERT INTO settings(id,days_per_month,current_month,current_day) VALUES (1,2,1,1) ON DUPLICATE KEY UPDATE id=id`,
`ALTER TABLE settings ADD COLUMN IF NOT EXISTS current_month TINYINT NOT NULL DEFAULT 1`,
`ALTER TABLE settings ADD COLUMN IF NOT EXISTS current_day TINYINT NOT NULL DEFAULT 1`,
`INSERT INTO settings(id,days_per_month,current_month,current_day) VALUES (1,2,1,1) ON DUPLICATE KEY UPDATE id=id`,
`UPDATE settings SET current_month=1 WHERE current_month < 1 OR current_month > 12`,
`UPDATE settings SET current_day=1 WHERE current_day < 1`,
`CREATE TABLE IF NOT EXISTS fields(
id BIGINT AUTO_INCREMENT PRIMARY KEY,