mirror of https://github.com/M66B/FairEmail.git
Refactoring
This commit is contained in:
parent
0a5cfdfbc9
commit
8565e53bfc
|
@ -489,13 +489,8 @@ public abstract class DB extends RoomDatabase {
|
||||||
Log.i("Get PRAGMA " + pragma + "=<?>");
|
Log.i("Get PRAGMA " + pragma + "=<?>");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG && false)
|
||||||
db.execSQL("DROP TRIGGER IF EXISTS `attachment_insert`");
|
dropTriggers(db);
|
||||||
db.execSQL("DROP TRIGGER IF EXISTS `attachment_delete`");
|
|
||||||
|
|
||||||
db.execSQL("DROP TRIGGER IF EXISTS `account_update`");
|
|
||||||
db.execSQL("DROP TRIGGER IF EXISTS `identity_update`");
|
|
||||||
}
|
|
||||||
|
|
||||||
createTriggers(db);
|
createTriggers(db);
|
||||||
}
|
}
|
||||||
|
@ -528,6 +523,14 @@ public abstract class DB extends RoomDatabase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void dropTriggers(@NonNull SupportSQLiteDatabase db) {
|
||||||
|
db.execSQL("DROP TRIGGER IF EXISTS `attachment_insert`");
|
||||||
|
db.execSQL("DROP TRIGGER IF EXISTS `attachment_delete`");
|
||||||
|
|
||||||
|
db.execSQL("DROP TRIGGER IF EXISTS `account_update`");
|
||||||
|
db.execSQL("DROP TRIGGER IF EXISTS `identity_update`");
|
||||||
|
}
|
||||||
|
|
||||||
private static void createTriggers(@NonNull SupportSQLiteDatabase db) {
|
private static void createTriggers(@NonNull SupportSQLiteDatabase db) {
|
||||||
List<String> image = new ArrayList<>();
|
List<String> image = new ArrayList<>();
|
||||||
for (String img : ImageHelper.IMAGE_TYPES)
|
for (String img : ImageHelper.IMAGE_TYPES)
|
||||||
|
|
Loading…
Reference in New Issue