Added index on operation name

This commit is contained in:
M66B 2019-03-03 12:59:58 +00:00
parent 1f80732916
commit 1a14a802b2
3 changed files with 1552 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@ -49,7 +49,7 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 48,
version = 49,
entities = {
EntityIdentity.class,
EntityAccount.class,
@ -530,6 +530,13 @@ public abstract class DB extends RoomDatabase {
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();
}

View File

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