Link log entries to accounts, folders and messages

This commit is contained in:
M66B
2021-08-16 13:07:41 +02:00
parent 4c6c72afd9
commit 0b3b3e6d2a
8 changed files with 2655 additions and 26 deletions

View File

@@ -67,7 +67,7 @@ import io.requery.android.database.sqlite.SQLiteDatabase;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 208,
version = 209,
entities = {
EntityIdentity.class,
EntityAccount.class,
@@ -2106,6 +2106,14 @@ public abstract class DB extends RoomDatabase {
Log.i("DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("ALTER TABLE `log` ADD COLUMN `type` INTEGER NOT NULL DEFAULT " + EntityLog.Type.General.ordinal());
}
}).addMigrations(new Migration(208, 209) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase db) {
Log.i("DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("ALTER TABLE `log` ADD COLUMN `account` INTEGER");
db.execSQL("ALTER TABLE `log` ADD COLUMN `folder` INTEGER");
db.execSQL("ALTER TABLE `log` ADD COLUMN `message` INTEGER");
}
}).addMigrations(new Migration(998, 999) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase db) {