mirror of
https://github.com/BetterCorp/BetterFrame.git
synced 2026-05-26 19:06:34 +00:00
fix(migrations): backfill missing hwmon columns on existing DBs
cpu_load_percent + memory/disk columns were silently added inline to the hwmon migration entry, but PRAGMA user_version had already passed that index for existing deploys → ALTER never ran → replaceKioskKey and heartbeat hit "no such column: cpu_load_percent" on upgrade. Append a tail migration that addColumnIfNotExists for each. Lesson: never mutate an existing migration entry; always append a new one.
This commit is contained in:
parent
5d225f7b49
commit
6b959755e7
1 changed files with 13 additions and 0 deletions
|
|
@ -867,4 +867,17 @@ export const MIGRATIONS: readonly MigrationEntry[] = [
|
|||
addColumnIfNotExists(db, "displays", "actual_power_state_at", "TEXT");
|
||||
},
|
||||
|
||||
// Backfill hwmon/telemetry columns. They were originally added inline to
|
||||
// an earlier migration entry; existing deploys had already passed that
|
||||
// index via PRAGMA user_version, so the new columns silently never landed.
|
||||
// Re-add idempotently here so replaceKioskKey / heartbeat stop hitting
|
||||
// "no such column" on upgrade.
|
||||
(db: DatabaseSync) => {
|
||||
addColumnIfNotExists(db, "kiosks", "cpu_load_percent", "REAL");
|
||||
addColumnIfNotExists(db, "kiosks", "memory_total_mb", "INTEGER");
|
||||
addColumnIfNotExists(db, "kiosks", "memory_used_mb", "INTEGER");
|
||||
addColumnIfNotExists(db, "kiosks", "disk_total_mb", "INTEGER");
|
||||
addColumnIfNotExists(db, "kiosks", "disk_free_mb", "INTEGER");
|
||||
addColumnIfNotExists(db, "kiosks", "disk_used_percent", "REAL");
|
||||
},
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in a new issue