Skip to content

Commit

Permalink
fix: do not set shadowDatabaseUrl in schema.prisma
Browse files Browse the repository at this point in the history
I ran into issues with the `prisma migrate` command:

```
Error: P3005

The database schema is not empty.
```

After some research, I was able to resolve the issue by removing the
`shadowDatabaseUrl` from `schema.prisma`.

> Important: Do not use the same values for url and shadowDatabaseUrl.
https://www.prisma.io/docs/concepts/components/prisma-migrate/shadow-database

> Do _not_ use `shadowDatabaseUrl` with Vercel Postgres any more,
> especially not with the same value as `url` or `directUrl`.
> The shadow database can be created dynamically.
prisma/prisma#19234 (comment)

See prisma/prisma#19234
  • Loading branch information
FelixZY committed Aug 26, 2023
1 parent 3f4cd23 commit 0d0829c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ generator client {
}

datasource db {
provider = "postgresql"
url = env("POSTGRES_PRISMA_URL") // uses connection pooling
directUrl = env("POSTGRES_URL_NON_POOLING") // uses a direct connection
shadowDatabaseUrl = env("POSTGRES_URL_NON_POOLING") // used for migrations
schemas = ["events", "portal", "profiles", "storage"]
extensions = [pg_trgm, postgis]
provider = "postgresql"
url = env("POSTGRES_PRISMA_URL") // uses connection pooling
directUrl = env("POSTGRES_URL_NON_POOLING") // uses a direct connection
schemas = ["events", "portal", "profiles", "storage"]
extensions = [pg_trgm, postgis]
}

enum ProfileType {
Expand Down

0 comments on commit 0d0829c

Please sign in to comment.