# `NeonDbError: relation "…" does not exist`

**Where it appears:** Terminal or Vercel runtime logs

**What it means:** Your code queried a database table (Postgres calls tables “relations”) that hasn't been created in this database branch yet.

## Likely causes

- New tables were added to the schema in code, but the database migration hasn't been run yet.
- The migration ran on your local development database branch, but not on the Preview or Production database yet.

## Message for your agent

```text
The database returned `relation does not exist`. Check which migrations or Better Auth tables are pending on this database branch, explain what will be created, and run the migration safely.
```

**Prevention:** Run database migrations as part of your deployment checklist whenever a task adds or changes a table.

---
Source: [Agentic Makers](https://agenticmakers.app/en/help/errors/postgres-relation-does-not-exist) · License: CC BY 4.0
