mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-26 23:50:58 +01:00
Added attachment size/progress
This commit is contained in:
@@ -40,7 +40,7 @@ import android.util.Log;
|
||||
EntityAttachment.class,
|
||||
EntityOperation.class
|
||||
},
|
||||
version = 2,
|
||||
version = 3,
|
||||
exportSchema = true
|
||||
)
|
||||
|
||||
@@ -75,6 +75,7 @@ public abstract class DB extends RoomDatabase {
|
||||
private static DB migrate(RoomDatabase.Builder<DB> builder) {
|
||||
return builder
|
||||
.addMigrations(MIGRATION_1_2)
|
||||
.addMigrations(MIGRATION_2_3)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -93,6 +94,15 @@ public abstract class DB extends RoomDatabase {
|
||||
}
|
||||
};
|
||||
|
||||
private static final Migration MIGRATION_2_3 = new Migration(2, 3) {
|
||||
@Override
|
||||
public void migrate(SupportSQLiteDatabase db) {
|
||||
Log.i(Helper.TAG, "DB migration from version " + startVersion + " to " + endVersion);
|
||||
db.execSQL("ALTER TABLE `attachment` ADD COLUMN `size` INTEGER");
|
||||
db.execSQL("ALTER TABLE `attachment` ADD COLUMN `progress` INTEGER");
|
||||
}
|
||||
};
|
||||
|
||||
public static class Converters {
|
||||
@TypeConverter
|
||||
public static byte[] fromString(String value) {
|
||||
|
||||
Reference in New Issue
Block a user