ework-daemon 0.4.8 → 0.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/db.ts +7 -1
package/package.json
CHANGED
package/src/db.ts
CHANGED
|
@@ -320,7 +320,13 @@ async function runMigrations(db: AsyncDatabase): Promise<void> {
|
|
|
320
320
|
|
|
321
321
|
const ensureColumn = async (table: string, col: string, ddl: string): Promise<void> => {
|
|
322
322
|
if (await hasColumn(table, col)) return;
|
|
323
|
-
|
|
323
|
+
try {
|
|
324
|
+
await db.exec(`ALTER TABLE ${table} ADD COLUMN ${ddl}`);
|
|
325
|
+
} catch (e) {
|
|
326
|
+
const errno = (e as { errno?: number }).errno;
|
|
327
|
+
if (errno === 1060 || errno === 30000) return;
|
|
328
|
+
throw e;
|
|
329
|
+
}
|
|
324
330
|
};
|
|
325
331
|
|
|
326
332
|
// ── id/uid swap: id becomes AUTO_INCREMENT PK, uid holds the UUID ──
|