forked from jsnbuchanan/crowd-funder-for-time-pwa
Fix database migration errors by improving error handling
- Enhanced migration service to handle duplicate column errors gracefully - Added detection for 'duplicate column' and 'already exists' errors - Migration service now marks partially applied migrations as complete - Prevents Electron app crashes due to cross-platform database conflicts - Improved robustness for database schema migrations Fixes database initialization issues when switching between platforms (web, mobile, electron) that may have different migration states.
This commit is contained in:
@@ -121,6 +121,11 @@ const MIGRATIONS = [
|
||||
{
|
||||
name: "002_add_iViewContent_to_contacts",
|
||||
sql: `
|
||||
-- We need to handle the case where iViewContent column might already exist
|
||||
-- SQLite doesn't support IF NOT EXISTS for ALTER TABLE ADD COLUMN
|
||||
-- So we'll use a more robust approach with error handling in the migration service
|
||||
|
||||
-- First, try to add the column - this will fail silently if it already exists
|
||||
ALTER TABLE contacts ADD COLUMN iViewContent BOOLEAN DEFAULT TRUE;
|
||||
`,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user