-1

How to detect if the database version has changed and perform actions in ActiveAndroid. Similar to onUpgrade in SQLiteDatabaseHelper?

vijaydev
  • 395
  • 4
  • 14

1 Answers1

0

The DatabaseHelper of ActiveAndroid doesn't seem to support what you're looking for. But it's on GitHub, so you can modify the library to your needs.

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    executePragmas(db);
    executeCreate(db);
    executeMigrations(db, oldVersion, newVersion);
}
tynn
  • 38,113
  • 8
  • 108
  • 143
  • I have put a log in onUpgrade() of DatabaseHelper and changed the ActiveAndroid db version in manifest file. Not getting the log. Anything else to do apart from this? – vijaydev May 09 '16 at 11:40
  • `onUpgrade()` only gets called if there's an old database already present. If that's the case, I don't have any idea. – tynn May 09 '16 at 12:24