Skip to content

Apply migrations on startup via migrate deploy#16

Merged
dsbaars merged 1 commit into
mainfrom
fix/entrypoint-migrate-deploy
Jun 24, 2026
Merged

Apply migrations on startup via migrate deploy#16
dsbaars merged 1 commit into
mainfrom
fix/entrypoint-migrate-deploy

Conversation

@dsbaars

@dsbaars dsbaars commented Jun 24, 2026

Copy link
Copy Markdown
Owner

The container entrypoint used prisma db push, which syncs the schema directly from schema.prisma and cannot run data-preserving migrations — adding a NOT NULL column to a populated table fails, and migration backfills (like #15's signing-log denormalization) never run.

Switch to prisma migrate deploy so committed migrations apply correctly on deploy.

Operational note: pre-existing databases (managed by db push, no _prisma_migrations table) must be baselined once before the first deploy with this entrypoint:

prisma migrate resolve --applied 20260330100000_initial_schema
prisma migrate resolve --applied 20260624000000_hash_refresh_tokens

The container entrypoint used `prisma db push`, which syncs the schema
directly and cannot run data-preserving migrations — e.g. adding a NOT
NULL column to a populated table fails, and migration backfills never
run. Switch to `prisma migrate deploy` so committed migrations (incl.
the signing-log decoupling backfill) apply correctly on deploy.

Pre-existing databases must be baselined once with
`prisma migrate resolve --applied <migration>` for the already-present
schema before the first deploy with this entrypoint.
@dsbaars dsbaars merged commit cff1edd into main Jun 24, 2026
4 checks passed
@dsbaars dsbaars deleted the fix/entrypoint-migrate-deploy branch June 24, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant