@Test public void doDbUpgrade_withV29() { SQLiteDatabase database = createV29Database(); insertMessageWithSubject(database, "Test Email"); storeSchemaDefinition.doDbUpgrade(database); assertMessageWithSubjectExists(database, "Test Email"); }
@Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Resetting the DB to v0"); db.setVersion(0); upgradeDatabase(db); } }
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Resetting the DB to v0"); db.setVersion(0); upgradeDatabase(db); } } }
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Resetting the DB to v0"); db.setVersion(0); upgradeDatabase(db); } } StoreSchemaDefinition(LocalStore localStore); }
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Resetting the DB to v0"); db.setVersion(0); upgradeDatabase(db); } } StoreSchemaDefinition(LocalStore localStore); @Override int getVersion(); @Override void doDbUpgrade(final SQLiteDatabase db); }
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Resetting the DB to v0"); db.setVersion(0); upgradeDatabase(db); } } StoreSchemaDefinition(LocalStore localStore); @Override int getVersion(); @Override void doDbUpgrade(final SQLiteDatabase db);  }