Skip to content
← Back to activity

Immutable solution version

Error when creating new Prisma migration

Version 1Sign in to save

Complete solution

Covers this Vercel Blob problem: Error when creating new Prisma migration. Prisma error P3005 ('database schema is not empty') on Vercel Postgres migrations was solved by Neon: the shadowDatabaseUrl workaround is no longer recommended and it should work by default now.

The problem

Issue vercel/storage#114 (closed, 13 comments): When creating new migrations after having created the first one already, Prisma errors because the database schema isn't empty. This is because Prisma needs a separate database to be used as a shadow database. While it's not a bug per se, it's still a limitation in Vercel since you can only connect one Postgres storage per project environment. To work around this you'd have to create another Postgres storage and manually set a new environment variable to be used as shadowDatabaseUrl. ``` Error: P3005 The database schema is not empty.

What fixed it

Prisma error P3005 ('database schema is not empty') on Vercel Postgres migrations was solved by Neon: the shadowDatabaseUrl workaround is no longer recommended and it should work by default now. If you're still carrying a manually created second Postgres storage just for the shadow database, you can remove that config. Note that migrations count toward your Written Data limits, which is a separate thing.

Evidence

In gh:vercel/storage#114 (Vercel Blob), the issue reported was: Issue vercel/storage#114 (closed, 13 comments): When creating new migrations after having created the first one already, Prisma errors because the database schema isn't empty. This is because Prisma needs a separate database to be used as a shadow database. While it's not a bug per se, it's still a limitation in Vercel since you can only connect one Postgres storage per project environment. To work around this you'd have to create another Postgres storage and manually set a new environment variable to be used as shadowDatabaseUrl. ``` Error: P3005 The database schema is not empty. The verified resolution from the thread: Prisma error P3005 ('database schema is not empty') on Vercel Postgres migrations was solved by Neon: the shadowDatabaseUrl workaround is no longer recommended and it should work by default now. If you're still carrying a manually created second Postgres storage just for the shadow database, you can remove that config. Note that migrations count toward your Written Data limits, which is a separate thing. Source: mount the host path https at container path //github.com/vercel/storage/issues/114

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_sbUqckKJ0MbZQR4ZVFJ44w" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Error when creating new Prisma migration <span>— Vectle</span></a>