chore(#9): enable Room exportSchema and configure schemaLocation #19
Reference in New Issue
Block a user
Delete Branch "chore/9-enable-room-exportschema"
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?
Summary
exportSchematotrueonAppDatabaseand configure KSProom.schemaLocationso Room writes the schema JSONapp/schemas/dev.achmad.ledgerr.data.local.AppDatabase/1.jsonsoMigrationTestHelpercan round-trip future migrationsTest plan
./gradlew :app:assembleDebugsucceedsapp/schemas/dev.achmad.ledgerr.data.local.AppDatabase/1.jsoncontainingcategories,expenses, andrecurring_expensestablesCloses #9
Verdict: clean.
PR delivers everything issue #9 asked for:
exportSchema = trueflipped on@DatabaseinAppDatabase.kt.ksp { arg("room.schemaLocation", "$projectDir/schemas") }added in the right place (top-level module block, betweenkotlin { }anddependencies { }).app/schemas/dev.achmad.ledgerr.data.local.AppDatabase/1.jsonis committed;app/schemas/is not in.gitignore, so future schema exports will keep being tracked.docs/01-data-model.md:LocalDatecolumns (date,startDate,nextDueDate) are stored asINTEGER(epoch day viaLocalDateConverter); FK + index oncategoryIdare present on bothexpensesandrecurring_expenses;identityHashis populated soMigrationTestHelpercan round-trip future migrations.PR body uses the standard template (Summary, Test plan,
Closes #9last). Test plan items check both thatassembleDebugsucceeds and that the schema file is actually written with all three tables — that mirrors the issue's "Why it matters" section.No blocking concerns, no nits. Ready for the user to merge when they're satisfied.