mirror of https://github.com/M66B/FairEmail.git
Fixed account view migration (2)
This commit is contained in:
parent
7d0e13493c
commit
7dcde6a5ef
|
@ -1604,11 +1604,8 @@ public abstract class DB extends RoomDatabase {
|
||||||
@Override
|
@Override
|
||||||
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
||||||
logMigration(startVersion, endVersion);
|
logMigration(startVersion, endVersion);
|
||||||
try {
|
db.execSQL("CREATE VIEW IF NOT EXISTS `account_view` AS " +
|
||||||
db.execSQL("CREATE VIEW IF NOT EXISTS `account_view` AS " + TupleAccountView.query);
|
TupleAccountView.query.replace(", category", ""));
|
||||||
} catch (Throwable ex) {
|
|
||||||
Log.w(ex);
|
|
||||||
}
|
|
||||||
db.execSQL("CREATE VIEW IF NOT EXISTS `identity_view` AS " + TupleIdentityView.query);
|
db.execSQL("CREATE VIEW IF NOT EXISTS `identity_view` AS " + TupleIdentityView.query);
|
||||||
db.execSQL("CREATE VIEW IF NOT EXISTS `folder_view` AS " + TupleFolderView.query);
|
db.execSQL("CREATE VIEW IF NOT EXISTS `folder_view` AS " + TupleFolderView.query);
|
||||||
}
|
}
|
||||||
|
@ -2148,12 +2145,9 @@ public abstract class DB extends RoomDatabase {
|
||||||
@Override
|
@Override
|
||||||
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
||||||
logMigration(startVersion, endVersion);
|
logMigration(startVersion, endVersion);
|
||||||
try {
|
db.execSQL("DROP VIEW IF EXISTS `account_view`");
|
||||||
db.execSQL("DROP VIEW IF EXISTS `account_view`");
|
db.execSQL("CREATE VIEW IF NOT EXISTS `account_view` AS " +
|
||||||
db.execSQL("CREATE VIEW IF NOT EXISTS `account_view` AS " + TupleAccountView.query);
|
TupleAccountView.query.replace(", category", ""));
|
||||||
} catch (Throwable ex) {
|
|
||||||
Log.w(ex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}).addMigrations(new Migration(207, 208) {
|
}).addMigrations(new Migration(207, 208) {
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue