Better encryption support

This commit is contained in:
M66B
2019-01-05 14:09:47 +00:00
parent 1a15a1e931
commit eb27f5015a
8 changed files with 1324 additions and 15 deletions

View File

@@ -49,7 +49,7 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 29,
version = 30,
entities = {
EntityIdentity.class,
EntityAccount.class,
@@ -377,6 +377,14 @@ public abstract class DB extends RoomDatabase {
db.execSQL("ALTER TABLE `folder` ADD COLUMN `last_sync` INTEGER");
}
})
.addMigrations(new Migration(29, 30) {
@Override
public void migrate(SupportSQLiteDatabase db) {
Log.i("DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("ALTER TABLE `attachment` ADD COLUMN `encryption` INTEGER");
db.execSQL("UPDATE attachment SET encryption = " + EntityAttachment.PGP_MESSAGE + " where name = 'encrypted.asc'");
}
})
.build();
}