This commit is contained in:
seb
2026-09-30 09:48:01 +02:00
parent 9885c489f0
commit 280a45a11f
28 changed files with 539 additions and 16 deletions

View File

@@ -431,6 +431,18 @@ export class BetterSqlite3Provider extends BetterSqlite3Executor {
if (propertynameCols.length > 0 && !propertynameCols.includes('exclusive')) {
this.db.exec(`ALTER TABLE propertyname ADD COLUMN exclusive INTEGER NOT NULL DEFAULT 0`);
}
const categoryCols = this.db.pragma('table_info("category")').map((c) => c.name);
if (categoryCols.length > 0 && !categoryCols.includes('updated_at')) {
this.db.exec(`ALTER TABLE category ADD COLUMN updated_at TEXT`);
this.db.exec(`UPDATE category SET updated_at = strftime('%Y-%m-%dT%H:%M:%fZ', 'now') WHERE updated_at IS NULL`);
}
const customergroupCols = this.db.pragma('table_info("customergroup")').map((c) => c.name);
if (customergroupCols.length > 0 && !customergroupCols.includes('updated_at')) {
this.db.exec(`ALTER TABLE customergroup ADD COLUMN updated_at TEXT`);
this.db.exec(`UPDATE customergroup SET updated_at = strftime('%Y-%m-%dT%H:%M:%fZ', 'now') WHERE updated_at IS NULL`);
}
} catch {
// ignore
}