ActiveAndroid icon indicating copy to clipboard operation
ActiveAndroid copied to clipboard

Migrations don't get run on Fresh install

Open laochiv opened this issue 12 years ago • 2 comments

Hey guys, Love the library!

I believe that when an app is installed, migrations don't get run. This may not be an issue for new apps, but it is an issue for apps which have versioned their databases already.

What I did was to place

Log.i("Migrating from " + oldVersion + " to " + newVersion);

in DatabaseHelper.executeMigrations() after the files are sorted.

The only log I am getting on install is "Migrating from -1 to 0". No matter what my database version is.

Should I be looking in another place? or is this really a bug? Thanks!

laochiv avatar May 25 '14 06:05 laochiv

I don't think this is a bug because on a fresh install the newest DB will be installed, meaning there's no need for migrations.

premnirmal avatar Jun 11 '14 21:06 premnirmal

That's probably Fair. I was trying to ship with a migration which prepopulated the DB. I changed it to be now shipping with a database which is probably what I should have done in the first place. But it just adds one more step to my build process :-)

laochiv avatar Jun 12 '14 20:06 laochiv