Update Arcor.de accounts

This commit is contained in:
M66B 2020-11-21 08:01:28 +01:00
parent 9b0c4e572e
commit 385e18364a
1 changed files with 13 additions and 1 deletions

View File

@ -64,7 +64,7 @@ import static eu.faircode.email.ServiceAuthenticator.AUTH_TYPE_PASSWORD;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 177,
version = 178,
entities = {
EntityIdentity.class,
EntityAccount.class,
@ -1738,6 +1738,18 @@ public abstract class DB extends RoomDatabase {
Log.i("DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("ALTER TABLE `account` ADD COLUMN `backoff_until` INTEGER");
}
})
.addMigrations(new Migration(177, 178) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase db) {
Log.i("DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("UPDATE folder" +
" SET poll = 1" +
" WHERE type <> '" + EntityFolder.INBOX + "'" +
" AND account IN" +
" (SELECT id FROM account" +
" WHERE host IN ('imap.arcor.de'))");
}
});
}