After modifying the sq file by renaming one of the tables and adding one more table I didn't find any place to specify that database schema or version has been changed and I want no migration - just recreate database. The documentation on official website does not contain any information about this.
Project compiles but when I run the app on both Android and iOS I get a runtime crash and in logs it says that added table does not exist.
I tried adding version in build.gradle.kts of shared module but I still get runtime crash:
sqldelight {
database("MyDatabase") {
packageName = "com.example.shared.cache"
version = 2 // added this line only
}
}
I don't want to delete and reinstall the app. Ideal solution would be something like fallbackToDestructiveMigration Room database has
I found this discussion about a destructive migration. Last comment suggests to handle that in platform specific drivers but it doesn't show how to do that.
So my questions are:
- How to change the database version?
- How to setup destructive migration?
I wish documentation was more detailed on various topics. It would make finding right information easier for developers like me who is not very experienced in Sqlite.