1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-30 19:56:10 +00:00

Refactoring

This commit is contained in:
M66B 2023-01-31 07:36:36 +01:00
parent 0a5cfdfbc9
commit 8565e53bfc

View file

@ -489,13 +489,8 @@ public abstract class DB extends RoomDatabase {
Log.i("Get PRAGMA " + pragma + "=<?>");
}
if (BuildConfig.DEBUG) {
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`");
}
if (BuildConfig.DEBUG && false)
dropTriggers(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) {
List<String> image = new ArrayList<>();
for (String img : ImageHelper.IMAGE_TYPES)