Resume last sync

This commit is contained in:
M66B
2018-09-05 21:05:03 +00:00
parent deaa30a5f3
commit 62ae0eeb17
8 changed files with 1893 additions and 2 deletions

View File

@@ -45,7 +45,7 @@ import androidx.sqlite.db.SupportSQLiteDatabase;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 10,
version = 12,
entities = {
EntityIdentity.class,
EntityAccount.class,
@@ -184,6 +184,20 @@ public abstract class DB extends RoomDatabase {
db.execSQL("UPDATE `folder` SET unified = 1 WHERE type = '" + EntityFolder.INBOX + "'");
}
})
.addMigrations(new Migration(10, 11) {
@Override
public void migrate(SupportSQLiteDatabase db) {
Log.i(Helper.TAG, "DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("ALTER TABLE `account` ADD COLUMN `last_sync` INTEGER");
}
})
.addMigrations(new Migration(11, 12) {
@Override
public void migrate(SupportSQLiteDatabase db) {
Log.i(Helper.TAG, "DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("ALTER TABLE `folder` ADD COLUMN `last_sync` INTEGER");
}
})
.build();
}