chore(web/scripts): migration runner via @neondatabase/serverless#12
Merged
Conversation
Single-file Node script that loads NEON_DATABASE_URL via
`node --env-file=.env.local`, splits a drizzle migration on the
`--> statement-breakpoint` marker, and runs each statement over
the existing HTTP driver.
Useful because:
- psql isn't always installed on dev machines (this came up
when shipping migration 0022).
- .claude/rules/db-migrations.md mandates manual application
against prod — this script is the manual path without
requiring brew/libpq.
- The same driver the runtime uses, so behavior is consistent
with what production would see.
Usage:
node --env-file=.env.local scripts/run-migration.mjs \\
src/db/migrations/0022_ai_tagging.sql
Reports per-statement OK/FAIL and bails on first error. Does not
write to a migrations journal — drizzle-kit owns _journal.json,
this is just for the apply step.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
xiaolai
added a commit
that referenced
this pull request
May 8, 2026
HIGH fixes: - project.rs: skip history rewrite on unresolved CC-dir conflict (#3) - desktop swap: add parent dir creation in snapshot/restore (#6) - desktop swap: rollback on phase-2 failure, clean partial restores on phase-3 failure (#7, #8) - cli_service: propagate UUID parse and read_default errors instead of silently losing credential backup (#5) MEDIUM fixes: - swap.rs/credfile.rs: fail-closed permission check — error if chmod fails instead of reading insecure file (#12, #13) - main.rs: make --merge/--overwrite mutually exclusive via clap conflicts_with (#23) - main.rs: make --from-current/--from-token mutually exclusive (#24) - project.rs CLI: use char-safe truncation to prevent panic on multibyte UTF-8 paths (#25) - doctor_service: treat 429/5xx as Unreachable, not Reachable (#19) - account.rs: wrap set_active_cli/desktop in transactions (#21) - project.rs: restrict prefix fallback to long paths only (#15) LOW fixes: - cli_ops: emit JSON for already-active account (#31)
xiaolai
added a commit
that referenced
this pull request
May 8, 2026
chore(web/scripts): migration runner via @neondatabase/serverless
xiaolai
added a commit
that referenced
this pull request
May 8, 2026
chore(web/scripts): migration runner via @neondatabase/serverless
xiaolai
added a commit
that referenced
this pull request
May 8, 2026
HIGH fixes: - project.rs: skip history rewrite on unresolved CC-dir conflict (#3) - desktop swap: add parent dir creation in snapshot/restore (#6) - desktop swap: rollback on phase-2 failure, clean partial restores on phase-3 failure (#7, #8) - cli_service: propagate UUID parse and read_default errors instead of silently losing credential backup (#5) MEDIUM fixes: - swap.rs/credfile.rs: fail-closed permission check — error if chmod fails instead of reading insecure file (#12, #13) - main.rs: make --merge/--overwrite mutually exclusive via clap conflicts_with (#23) - main.rs: make --from-current/--from-token mutually exclusive (#24) - project.rs CLI: use char-safe truncation to prevent panic on multibyte UTF-8 paths (#25) - doctor_service: treat 429/5xx as Unreachable, not Reachable (#19) - account.rs: wrap set_active_cli/desktop in transactions (#21) - project.rs: restrict prefix fallback to long paths only (#15) LOW fixes: - cli_ops: emit JSON for already-active account (#31)
xiaolai
added a commit
that referenced
this pull request
May 8, 2026
chore(web/scripts): migration runner via @neondatabase/serverless
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
web/scripts/run-migration.mjs— a single-file Node script that loadsNEON_DATABASE_URLvianode --env-file=.env.local, splits a drizzle migration on the--> statement-breakpointmarker, and runs each statement over the existing HTTP driver (@neondatabase/serverless).Why
psqlisn't always installed on dev machines (came up when shipping migration 0022)..claude/rules/db-migrations.mdmandates manual application against prod — this script is the manual path without requiringbrew install libpq.Usage
Reports per-statement OK/FAIL and bails on first error. Does not touch
_journal.json— drizzle-kit owns the journal; this is just the apply step.Test plan