Dateien nach "backend/src" hochladen
This commit is contained in:
@@ -161,9 +161,12 @@ if (!ordCols.includes('bezahlt_am')) db.exec("ALTER TABLE orders ADD COLUMN beza
|
|||||||
const fileCols = db.prepare("PRAGMA table_info(files)").all().map(r => r.name);
|
const fileCols = db.prepare("PRAGMA table_info(files)").all().map(r => r.name);
|
||||||
if (!fileCols.includes('folder_id')) db.exec("ALTER TABLE files ADD COLUMN folder_id INTEGER REFERENCES folders(id) ON DELETE SET NULL");
|
if (!fileCols.includes('folder_id')) db.exec("ALTER TABLE files ADD COLUMN folder_id INTEGER REFERENCES folders(id) ON DELETE SET NULL");
|
||||||
|
|
||||||
// folder_shares migrations
|
// folder_shares migrations (only if table exists)
|
||||||
const fsCols = db.prepare("PRAGMA table_info(folder_shares)").all().map(r => r.name);
|
const fsTableExists = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='folder_shares'").get();
|
||||||
if (!fsCols.includes('created_at')) db.exec("ALTER TABLE folder_shares ADD COLUMN created_at DATETIME DEFAULT CURRENT_TIMESTAMP");
|
if (fsTableExists) {
|
||||||
|
const fsCols = db.prepare("PRAGMA table_info(folder_shares)").all().map(r => r.name);
|
||||||
|
if (!fsCols.includes('created_at')) db.exec("ALTER TABLE folder_shares ADD COLUMN created_at DATETIME DEFAULT CURRENT_TIMESTAMP");
|
||||||
|
}
|
||||||
|
|
||||||
const oiCols = db.prepare("PRAGMA table_info(order_items)").all().map(r => r.name);
|
const oiCols = db.prepare("PRAGMA table_info(order_items)").all().map(r => r.name);
|
||||||
if (!oiCols.includes('stunden')) db.exec("ALTER TABLE order_items ADD COLUMN stunden REAL NOT NULL DEFAULT 0");
|
if (!oiCols.includes('stunden')) db.exec("ALTER TABLE order_items ADD COLUMN stunden REAL NOT NULL DEFAULT 0");
|
||||||
|
|||||||
Reference in New Issue
Block a user