u
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user