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

URL: https://antideploy.com/blog/relation-does-not-exist-database-tables-missing

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

**What you see**

```
error: relation "users" does not exist
    at Parser.parseErrorMessage ...

psycopg.errors.UndefinedTable: relation "users" does not exist
```

## At a glance

- **What it means**: The tables were never created
- **Detected tools**: Prisma, Drizzle, Alembic, Django
- **Runs before release**: A failed migration fails the deploy
- **Other tools**: Run them before the app listens

Published 7 October 2026. Facts checked 7 October 2026. 1 min read.

## 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.

## Table questions, answered.

Anything else? Write to us and a person answers.

[support@antideploy.com](mailto: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.

## More guides, and the platform.

Each platform page covers one part of Antideploy: what it does, where it stops and the questions people ask. [See the whole platform](https://antideploy.com/platform), or [all the guides](https://antideploy.com/blog).

- [How to add a Postgres database to your app](https://antideploy.com/blog/how-to-add-a-postgres-database-to-your-app): Ask your agent. A Postgres 17 database is created beside your app and DATABASE_URL is set.
- [Your app built successfully but never started listening on its port](https://antideploy.com/blog/your-app-built-successfully-but-never-started-listening-on-its-port): The app built but never answered on its port. Read PORT, listen on 0.0.0.0 and check the logs.
- [Error: connect ECONNREFUSED 127.0.0.1:5432](https://antideploy.com/blog/econnrefused-127-0-0-1-5432-cannot-connect-to-the-database): Your app tries to reach a database on localhost. Read DATABASE_URL and create a hosted database.

- [Database](https://antideploy.com/platform/database)
- [Deployments](https://antideploy.com/platform/deployments)
- [Logs and monitoring](https://antideploy.com/platform/logs-and-monitoring)

Facts on this page were checked against the live platform on 7 October 2026.

## 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.

To set this up, give your coding agent this sentence:

```text
Set this project up to deploy on Antideploy. Fetch https://antideploy.com/agent.md and follow it.
```
