forked from trent_larson/crowd-funder-for-time-pwa
fix: Resolve database migration conflicts with INSERT OR IGNORE
- Updated migration 001_initial to use INSERT OR IGNORE for secret and settings tables - Prevents unique constraint failures when database already exists from previous runs - Allows clean migration process without requiring database deletion - Database initialization now works properly in development environment Fixes: - UNIQUE constraint failed: secret.id error resolved - Migration process now handles existing data gracefully - Fresh database creation works without conflicts - Electron app now starts successfully with working database All major Electron issues resolved: ✅ TypeScript compilation working ✅ SQLite plugin properly configured ✅ UI assets loading correctly ✅ Database migrations successful ✅ App startup and initialization working
This commit is contained in:
@@ -53,7 +53,7 @@ const MIGRATIONS = [
|
||||
secretBase64 TEXT NOT NULL
|
||||
);
|
||||
|
||||
INSERT INTO secret (id, secretBase64) VALUES (1, '${secretBase64}');
|
||||
INSERT OR IGNORE INTO secret (id, secretBase64) VALUES (1, '${secretBase64}');
|
||||
|
||||
CREATE TABLE IF NOT EXISTS settings (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
@@ -89,7 +89,7 @@ const MIGRATIONS = [
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_settings_accountDid ON settings(accountDid);
|
||||
|
||||
INSERT INTO settings (id, apiServer) VALUES (1, '${DEFAULT_ENDORSER_API_SERVER}');
|
||||
INSERT OR IGNORE INTO settings (id, apiServer) VALUES (1, '${DEFAULT_ENDORSER_API_SERVER}');
|
||||
|
||||
CREATE TABLE IF NOT EXISTS contacts (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
|
||||
Reference in New Issue
Block a user