switch drizzle to runtime migrations #3

Open
seanlindell wants to merge 1 commit from claude/inspiring-poitras-6fa85c into main
seanlindell commented 2026-05-02 01:55:41 +00:00 (Migrated from github.com)

Move from drizzle-kit push against each database manually to committed SQL migration files applied automatically on Nitro boot. Eliminates the need to manually connect to prod after every schema change.

  • track drizzle/ in git
  • add server/plugins/00.migrate.ts to run migrate() on server startup
  • add db:generate and db:migrate scripts
  • add shared/db/run-migrations.ts as the standalone runner
  • remove legacy one-off backfill in shared/db/migrate.ts
  • update CLAUDE.md with the new workflow including --custom for data migrations

Follow-up (must run manually before merging):

  1. wipe stale local drizzle/ folder, then pnpm db:generate --name baseline
  2. against dev + prod DBs, create drizzle.__drizzle_migrations and insert the baseline hash so existing schemas aren't re-created on first boot
Move from `drizzle-kit push` against each database manually to committed SQL migration files applied automatically on Nitro boot. Eliminates the need to manually connect to prod after every schema change. - track drizzle/ in git - add server/plugins/00.migrate.ts to run migrate() on server startup - add db:generate and db:migrate scripts - add shared/db/run-migrations.ts as the standalone runner - remove legacy one-off backfill in shared/db/migrate.ts - update CLAUDE.md with the new workflow including --custom for data migrations Follow-up (must run manually before merging): 1. wipe stale local drizzle/ folder, then `pnpm db:generate --name baseline` 2. against dev + prod DBs, create drizzle.__drizzle_migrations and insert the baseline hash so existing schemas aren't re-created on first boot
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin claude/inspiring-poitras-6fa85c:claude/inspiring-poitras-6fa85c
git switch claude/inspiring-poitras-6fa85c

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff claude/inspiring-poitras-6fa85c
git switch claude/inspiring-poitras-6fa85c
git rebase main
git switch main
git merge --ff-only claude/inspiring-poitras-6fa85c
git switch claude/inspiring-poitras-6fa85c
git rebase main
git switch main
git merge --no-ff claude/inspiring-poitras-6fa85c
git switch main
git merge --squash claude/inspiring-poitras-6fa85c
git switch main
git merge --ff-only claude/inspiring-poitras-6fa85c
git switch main
git merge claude/inspiring-poitras-6fa85c
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
seanlindell/TimeHex!3
No description provided.