Migrate an in-process Postgres from committed migrations #367
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
spec
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#368 The API boots on its database, in dev and in CI
amaurycoudr/chess-project
Reference
amaurycoudr/chess-project#367
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
Parent
#354
What to build
Stories 7, 8, 9 and 18 of #354. Bring Drizzle into the API at the exact release candidate ADR 0031 pins (
drizzle-ormanddrizzle-kitat the same RC;drizzle-kita dev dependency;node-postgresas the production driver). Add an empty schema and one baseline migration with no table, generated bydrizzle-kitand committed, so the whole path runs end to end.Add the API's framework-free database module in its shared folder. From a database URL it builds the Drizzle handle, checks the database answers, migrates from the committed migrations, and closes the pool. Its integration tests run on an in-process Postgres (PGlite) built per test file with the real migrations, a test-only dependency pinned exactly. A test in the gate fails when the schema has a change that no committed migration captures.
Write the ADR the spec calls for: API tests run on an in-process Postgres (PGlite) with the real migrations; dev, CI and every stack run real Postgres. Add its row to the ADR index. Nothing boots on the database yet. See #354, Migrations, API wiring and Local dev, tests and CI.
Seam: the API's database module (connect and migrate), integration tests against an in-process Postgres.
Acceptance criteria
pnpm test, and the committed baseline passes it.drizzle-ormanddrizzle-kitsit at the same exact RC with no caret; PGlite is a pinned dev dependency.pnpm testor the pre-commit hook.mentioned in issue #368
mentioned in issue #354
marked this issue as related to #354
marked this issue as related to #368
mentioned in merge request !506