Skip to content
Permalink
Browse files

Add Room migration path

Room is only used for FTS. destructive migration path is enough.

Change-Id: Id54688b29f93eb9e85166571632e7b2f0a8d42ed
  • Loading branch information...
thagikura committed Apr 22, 2019
1 parent 6ecfe6e commit 3c933eae9be6a29b84b5de0d29348768cb168437
@@ -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.
You can’t perform that action at this time.