Enable Room exportSchema and configure schemaLocation #9
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Review of PR #8 flagged that
AppDatabaseis usingexportSchema = false. This is fine for v1, but we need to flip it totrueand configureroom.schemaLocationbefore any future migration lands. Without exported schemas, Room'sMigrationTestHelpercan't auto-test migrations and we lose the safety netandroidx.room:room-testingprovides.What to do
exportSchema = trueon@Databaseinapp/src/main/java/dev/achmad/ledgerr/data/local/AppDatabase.kt.app/build.gradle.kts:app/schemas/directory (Room writes it on every annotation-processed build).app/schemas/to git tracking (don't.gitignoreit).Why it matters
room-testingto doMigrationTestHelperround-trips.When to do it
@Database(version = N).Out of scope
room-testing.