chore(#9): enable Room exportSchema and configure schemaLocation #19

Merged
admin merged 1 commits from chore/9-enable-room-exportschema into main 2026-06-28 12:55:35 +00:00
Owner

Summary

  • Flip exportSchema to true on AppDatabase and configure KSP room.schemaLocation so Room writes the schema JSON
  • Commit the generated app/schemas/dev.achmad.ledgerr.data.local.AppDatabase/1.json so MigrationTestHelper can round-trip future migrations

Test plan

  • ./gradlew :app:assembleDebug succeeds
  • KSP writes app/schemas/dev.achmad.ledgerr.data.local.AppDatabase/1.json containing categories, expenses, and recurring_expenses tables

Closes #9

## Summary - Flip `exportSchema` to `true` on `AppDatabase` and configure KSP `room.schemaLocation` so Room writes the schema JSON - Commit the generated `app/schemas/dev.achmad.ledgerr.data.local.AppDatabase/1.json` so `MigrationTestHelper` can round-trip future migrations ## Test plan - [x] `./gradlew :app:assembleDebug` succeeds - [x] KSP writes `app/schemas/dev.achmad.ledgerr.data.local.AppDatabase/1.json` containing `categories`, `expenses`, and `recurring_expenses` tables Closes #9
admin added 1 commit 2026-06-28 12:51:41 +00:00
admin reviewed 2026-06-28 12:54:41 +00:00
admin left a comment
Author
Owner

Verdict: clean.

PR delivers everything issue #9 asked for:

  1. exportSchema = true flipped on @Database in AppDatabase.kt.
  2. ksp { arg("room.schemaLocation", "$projectDir/schemas") } added in the right place (top-level module block, between kotlin { } and dependencies { }).
  3. Generated app/schemas/dev.achmad.ledgerr.data.local.AppDatabase/1.json is committed; app/schemas/ is not in .gitignore, so future schema exports will keep being tracked.
  4. The committed schema matches the entity classes and docs/01-data-model.md: LocalDate columns (date, startDate, nextDueDate) are stored as INTEGER (epoch day via LocalDateConverter); FK + index on categoryId are present on both expenses and recurring_expenses; identityHash is populated so MigrationTestHelper can round-trip future migrations.

PR body uses the standard template (Summary, Test plan, Closes #9 last). Test plan items check both that assembleDebug succeeds 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.

**Verdict: clean.** PR delivers everything issue #9 asked for: 1. `exportSchema = true` flipped on `@Database` in `AppDatabase.kt`. 2. `ksp { arg("room.schemaLocation", "$projectDir/schemas") }` added in the right place (top-level module block, between `kotlin { }` and `dependencies { }`). 3. Generated `app/schemas/dev.achmad.ledgerr.data.local.AppDatabase/1.json` is committed; `app/schemas/` is not in `.gitignore`, so future schema exports will keep being tracked. 4. The committed schema matches the entity classes and `docs/01-data-model.md`: `LocalDate` columns (`date`, `startDate`, `nextDueDate`) are stored as `INTEGER` (epoch day via `LocalDateConverter`); FK + index on `categoryId` are present on both `expenses` and `recurring_expenses`; `identityHash` is populated so `MigrationTestHelper` can round-trip future migrations. PR body uses the standard template (Summary, Test plan, `Closes #9` last). Test plan items check both that `assembleDebug` succeeds 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.
admin merged commit a3c0976edd into main 2026-06-28 12:55:35 +00:00
admin deleted branch chore/9-enable-room-exportschema 2026-06-28 15:01:49 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/ledgerr#19