(tokens, i, params, filters)
| 3390 | // Integrity / orphan cleanup: deferred in app.whenReady so startup is not blocked (see setTimeout there) |
| 3391 | |
| 3392 | return true; |
| 3393 | } catch (err) { |
| 3394 | console.error('Error initializing database:', err); |
| 3395 | dialog.showErrorBox('Database Error', |
| 3396 | `Failed to initialize database: ${err.message}\n\nPath: ${getDatabasePath()}\n\nPlease ensure the application has write permissions to its directory.` |
| 3397 | ); |
| 3398 | return false; |
| 3399 | } |
| 3400 | } |
| 3401 | |
| 3402 | // Add migration function for dateAdded column |
| 3403 | function migrateDateAddedColumn() { |
| 3404 | try { |
| 3405 | console.log('Checking for dateAdded column migration...'); |
| 3406 | |
| 3407 | // Check if dateAdded column exists |
| 3408 | const tableInfo = db.prepare("PRAGMA table_info(models)").all(); |
| 3409 | const hasDateAdded = tableInfo.some(col => col.name === 'dateAdded'); |
| 3410 |
no test coverage detected