Initially sync 7 days, default sync 1 day

This commit is contained in:
M66B
2018-12-11 12:18:26 +01:00
parent f8b9640ca1
commit afe3832364
10 changed files with 1285 additions and 27 deletions

View File

@@ -46,7 +46,7 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 21,
version = 22,
entities = {
EntityIdentity.class,
EntityAccount.class,
@@ -292,6 +292,14 @@ public abstract class DB extends RoomDatabase {
db.execSQL("ALTER TABLE `identity` ADD COLUMN `bcc` TEXT");
}
})
.addMigrations(new Migration(21, 22) {
@Override
public void migrate(SupportSQLiteDatabase db) {
Log.i(Helper.TAG, "DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("ALTER TABLE `folder` ADD COLUMN `initialize` INTEGER NOT NULL DEFAULT 1");
db.execSQL("UPDATE `folder` SET sync_days = 1");
}
})
.build();
}