One entryMerged PR· crunch.stumason.dev· PHP
PR #40 merged: fix(deploy): stop the database volume shadowing migrations
additions
+19
deletions
-5
files changed
3
What
Prod never ran a migration shipped after 2026-06-30, because the compose mounted the SQLite volume at /app/database — shadowing the image's database/migrations/ directory. Boot-time migrate saw only the stale volume copy of the migrations dir, reported "Nothing to migrate", and the entrypoint's || true swallowed every trace. First casualty: inference_jobs.progress (#39) — new code live, column missing, pack jobs dead on arrival with no such column: progress.
Changes
- compose: same named
databasevolume (data carries over — it's re-mounted, not recreated), mount moved to/data/db, andDB_DATABASE=/data/db/database.sqliteset in the app env. The image'sdatabase/migrations/is now visible toartisan migrate. - Dockerfile: pre-creates
/data/dbwith the same ownership as the other runtime dirs. - entrypoint: migrate failures still don't crash-loop the container (transient SQLite locks shouldn't take the app down), but they now shout
!!! MIGRATE FAILEDto stderr instead of vanishing.
Deploy notes
- The existing DB file sits at the volume root, so after the remount it's at
/data/db/database.sqlite— no data copy needed. (The volume also contains a stale frozen copy ofmigrations//factories//seeders/from its first-ever mount; harmless clutter, can be cleaned any time.) - Prod's
progresscolumn + itsmigrationsrow were already reconciled manually tonight, so first boot after this should log "Nothing to migrate" — from the real directory this time. - Verify the deploy actually goes out (the webhook build died on resource exhaustion earlier tonight and needed an API retry).
🤖 Generated with Claude Code