I'm using FMDB IOS framework to manage my sqlite database.
But now I have second version of my database, so I need to update my sqlite file (on devices with installed app)
Here is my steps: (database is in Application Support/db/db.sqlite )
- create second . sqlite file (named "2_db.sqlite") and copy it into my main Bundle
Use this code on every start
-(void)migrateWithDBAtPath:(NSString *)dbPath { FMDBMigrationManager *manager = [FMDBMigrationManager managerWithDatabaseAtPath:dbPath migrationsBundle:[NSBundle mainBundle]]; NSError *error = nil; BOOL success = [manager migrateDatabaseToVersion:UINT64_MAX progress:nil error:&error]; }
dbPath is .../Library/Application Support/db/db.sqlite
But after this steps I have no migration and 0 pendingVersions in migrateDatabaseToVersion:progress:error:
What am I doing wrong? Thanks.