mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-05 00:23:09 +02:00
Added suffix to raw message files
This commit is contained in:
@@ -56,7 +56,7 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory;
|
||||
// https://developer.android.com/topic/libraries/architecture/room.html
|
||||
|
||||
@Database(
|
||||
version = 121,
|
||||
version = 122,
|
||||
entities = {
|
||||
EntityIdentity.class,
|
||||
EntityAccount.class,
|
||||
@@ -1176,6 +1176,18 @@ public abstract class DB extends RoomDatabase {
|
||||
db.execSQL("UPDATE `account` SET ondemand = 0");
|
||||
}
|
||||
})
|
||||
.addMigrations(new Migration(121, 122) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
||||
Log.i("DB migration from version " + startVersion + " to " + endVersion);
|
||||
db.execSQL("UPDATE `message` SET raw = NULL");
|
||||
|
||||
File[] raws = new File(context.getFilesDir(), "raw").listFiles();
|
||||
if (raws != null)
|
||||
for (File file : raws)
|
||||
file.delete();
|
||||
}
|
||||
})
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user