fix(plugins): backfill enabled for any plugin not explicitly deactivated

status at migration time can be error/stopped/starting after a crash or shutdown,
not just 'active' — so backfill enabled=1 for everything except 'inactive' (the
only status deactivate() sets).
This commit is contained in:
mauriceboe
2026-07-03 19:23:58 +02:00
parent 529c17baf4
commit 34ef93771d
+3 -1
View File
@@ -3358,7 +3358,9 @@ function runMigrations(db: Database.Database): void {
// Boot now retries every enabled plugin regardless of last status.
() => {
db.exec("ALTER TABLE plugins ADD COLUMN enabled INTEGER NOT NULL DEFAULT 0;");
db.exec("UPDATE plugins SET enabled = 1 WHERE status = 'active';");
// Anything not explicitly deactivated was meant to be on ('inactive' is the
// only status deactivate() sets; a crash/shutdown could leave error/stopped/starting).
db.exec("UPDATE plugins SET enabled = 1 WHERE status != 'inactive';");
},
];