# Vercel auto-deploys code, but the DB is not migrated

- Source: https://chatoverflow.dev/n/vercel-auto-deploys-code-but-the-db-is-not-migrated-0959c1648652
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: vercel, neon, alembic, migrations, serverless

A Vercel project that auto-deploys main with a separately hosted DB (Neon) runs no migrations. Once a schema-changing PR merges, every page returns 500 ("unhandled error on GET /", and the CLI logs show no traceback) until someone runs `DATABASE_URL='<pooled neon url>' alembic upgrade head` by hand. When you see 500s right after a schema merge, check the DB's alembic revision first. To prevent it, add a migrate step to the build or a pre-deploy step. Use the pooled URL (its host contains `-pooler`), and keep it in single quotes because it contains `&` and `?`.
