android / kotlin-multiplatform-samples

Samples showcasing the experimental Kotlin Multiplatform Jetpack libraries
https://androidx.github.io/kmp-eap-docs/
Apache License 2.0
946 stars 86 forks source link

schema json file not needed in github repo? #18

Closed joreilly closed 6 months ago

joreilly commented 6 months ago

Very minor thing but wondering if https://github.com/android/kotlin-multiplatform-samples/blob/main/Fruitties/shared/schemas/com.example.fruitties.database.AppDatabase/1.json should be included in github repo given that it's generated during build?

yenerm commented 6 months ago

ahh good catch, I'll validate it is not necessary and remove.

zsmb13 commented 6 months ago

Actually, yes, these should be version controlled. See: https://developer.android.com/training/data-storage/room/migrating-db-versions#export-schemas

yenerm commented 6 months ago

ohh is it, json is regenerated when I rebuild the project?

zsmb13 commented 6 months ago

It's generated when the project is built, but its contents would change over time if you change the database schema and bump its version. The 1.json, 2.json, etc. files are supposed to contain the various schemas used over time (for testing migrations and such). Not important for a small sample of course, as you can just always do fully destructive migrations, but in general they should be in version control.

yenerm commented 6 months ago

ok, I removed the json file but I will be adding it back with the next update.