mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
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:
@@ -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';");
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user