BlogPostgres

relation "users" does not exist How to fix it.

The database is there but the tables are not. Your migration did not run, or Antideploy did not detect your migration tool.

How the Agent API works
What you see
error: relation "users" does not exist
    at Parser.parseErrorMessage ...

psycopg.errors.UndefinedTable: relation "users" does not exist
  • What it meansThe tables were never created
  • Detected toolsPrisma, Drizzle, Alembic, Django
  • Runs before releaseA failed migration fails the deploy
  • Other toolsRun them before the app listens

What it means

Your app connected to the database and asked for a table named users. The database has no such table. A new database starts empty, and something has to create the tables.

How to fix it

  • Your tool is detected. Antideploy runs Prisma, Drizzle, Alembic and Django migrations before the new version goes live: npx prisma migrate deploy (or npx prisma db push without a migrations folder), npx drizzle-kit migrate, alembic upgrade head, and python manage.py migrate. If you see this error anyway, check that the migration files are committed and the tool is in your project.
  • Your tool is not detected. For Knex, TypeORM, Sequelize or plain SQL files, run the migration when the app starts, before it begins listening. For example, a start script such as node migrate.js && node server.js.
  • The migration ran against another database. Check that your code reads DATABASE_URL, and that your own DATABASE_URL, if you set one, points where you expect.

Steps

  1. Check the deploy history

    The deploy shows whether a migration ran, and whether it failed.

  2. Add or fix the migration

    Make the migration create the table, and commit it.

  3. Deploy again

    A failed migration fails the deploy, so a version your schema cannot support is never released. A failed deploy never counts against your plan.

01Questions

Table questions, answered.

Anything else? Write to us and a person answers.

support@antideploy.com
Why did it work locally?

Locally you created the tables earlier, and your local database kept them.

Does Antideploy keep my data between deploys?

Yes. The database belongs to the application, and every deploy reuses it. Only the container's disk is replaced.

Does this failed deploy cost anything?

No. Failed deploys never count against your plan.

Deploy something. Start with one sentence.

Paste one sentence into your coding agent, click Approve once, and get a live link. No card, no trial clock.

Start from GitHub or a folder
Prompt copied Paste it into Claude Code, Codex or Cursor and press Enter.