This commit is contained in:
seb
2026-09-24 23:26:25 +02:00
parent 075b1f0ddc
commit f8f61a1212
40 changed files with 1245 additions and 337 deletions

View File

@@ -385,6 +385,18 @@ export class BetterSqlite3Provider extends BetterSqlite3Executor {
this.db.exec(script);
}
}
// Ensure created_at exists on ledger table if created previously
try {
const ledgerCols = this.db.pragma('table_info("ledger")').map((c) => c.name);
if (ledgerCols.length > 0 && !ledgerCols.includes('created_at')) {
this.db.exec(
`ALTER TABLE ledger ADD COLUMN created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))`,
);
}
} catch {
// ignore
}
}
/**