Skip to content

fix(db): serialize concurrent migrations - #81

Merged
samithreddychinni merged 1 commit into
mainfrom
fix/migration-lock
Oct 3, 2026
Merged

samithreddychinni merged 1 commit into
mainfrom
fix/migration-lock

Conversation

@samithreddychinni

Copy link
Copy Markdown
Owner

Concurrent startup can apply and record the same migration more than once. Serialize migrations with a PostgreSQL advisory lock on one dedicated connection.

Close that session after success or failure. Add tests for eight simultaneous calls on an empty schema and recovery after a failed migration.

Run the race tests with DATABASE_URL set to a fresh, empty PostgreSQL database.

Tested:

go test -race ./...
go vet ./...

@vercel

vercel Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
paystable Ready Ready Preview Oct 3, 2026 9:48am UTC

@samithreddychinni
samithreddychinni merged commit b4d006a into main Oct 3, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
Preview — 101c5ff5 Deployed Oct 3, 2026 by vercel[bot]
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