Added index on operation name

pull/152/head
M66B 6 years ago
parent 1f80732916
commit 1a14a802b2

File diff suppressed because it is too large Load Diff

@ -49,7 +49,7 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory;
// https://developer.android.com/topic/libraries/architecture/room.html // https://developer.android.com/topic/libraries/architecture/room.html
@Database( @Database(
version = 48, version = 49,
entities = { entities = {
EntityIdentity.class, EntityIdentity.class,
EntityAccount.class, EntityAccount.class,
@ -530,6 +530,13 @@ public abstract class DB extends RoomDatabase {
db.execSQL("UPDATE `identity` SET use_ip = 1"); db.execSQL("UPDATE `identity` SET use_ip = 1");
} }
}) })
.addMigrations(new Migration(48, 49) {
@Override
public void migrate(SupportSQLiteDatabase db) {
Log.i("DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("CREATE INDEX `index_operation_name` ON `operation` (`name`)");
}
})
.build(); .build();
} }

@ -49,7 +49,8 @@ import static androidx.room.ForeignKey.CASCADE;
}, },
indices = { indices = {
@Index(value = {"folder"}), @Index(value = {"folder"}),
@Index(value = {"message"}) @Index(value = {"message"}),
@Index(value = {"name"})
} }
) )
public class EntityOperation { public class EntityOperation {

Loading…
Cancel
Save