Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Add Room migration path
Room is only used for FTS. destructive migration path is enough.

Change-Id: Id54688b29f93eb9e85166571632e7b2f0a8d42ed
  • Loading branch information
thagikura committed Aug 14, 2019
1 parent 6ecfe6e commit 3c933ea
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -40,7 +40,12 @@ abstract class AppDatabase : RoomDatabase() {
private const val databaseName = "iosched-db"

fun buildDatabase(context: Context): AppDatabase {
return Room.databaseBuilder(context, AppDatabase::class.java, databaseName).build()
// Since Room is only used for FTS, destructive migration is enough because the tables
// are cleared every time the app launches.
// https://medium.com/androiddevelopers/understanding-migrations-with-room-f01e04b07929
return Room.databaseBuilder(context, AppDatabase::class.java, databaseName)
.fallbackToDestructiveMigration()
.build()
}
}
}

0 comments on commit 3c933ea

Please sign in to comment.