Add index to message.ui_seen

This commit is contained in:
M66B
2018-08-05 11:44:46 +00:00
parent c748c96d98
commit 10e96f6a3f
3 changed files with 671 additions and 3 deletions

View File

@@ -40,7 +40,7 @@ import android.util.Log;
EntityAttachment.class,
EntityOperation.class
},
version = 3,
version = 4,
exportSchema = true
)
@@ -76,6 +76,7 @@ public abstract class DB extends RoomDatabase {
return builder
.addMigrations(MIGRATION_1_2)
.addMigrations(MIGRATION_2_3)
.addMigrations(MIGRATION_3_4)
.build();
}
@@ -103,6 +104,14 @@ public abstract class DB extends RoomDatabase {
}
};
private static final Migration MIGRATION_3_4 = new Migration(3, 4) {
@Override
public void migrate(SupportSQLiteDatabase db) {
Log.i(Helper.TAG, "DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("CREATE INDEX `index_message_ui_seen` ON `message` (`ui_seen`)");
}
};
public static class Converters {
@TypeConverter
public static byte[] fromString(String value) {