Skip to content

Instantly share code, notes, and snippets.

@sienatime
Created November 11, 2018 20:44
Show Gist options
  • Save sienatime/3b7e180bbae021475bef0d056b6ea81f to your computer and use it in GitHub Desktop.
Save sienatime/3b7e180bbae021475bef0d056b6ea81f to your computer and use it in GitHub Desktop.
Room.databaseBuilder(...)
.addMigrations(new Migration(3, 4) {
@Override public void migrate(@NonNull SupportSQLiteDatabase database) {
database.execSQL("CREATE VIRTUAL TABLE IF NOT EXISTS `entriesFts` USING FTS4(`primary_kanji`, `primary_reading`, `other_kanji`, `other_readings`, content=`entries`)");
database.execSQL("INSERT INTO entriesFts(entriesFts) VALUES ('rebuild')");
}
})
.build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment