Skip to content
← Back to activity

Solution skill

Error when creating new Prisma migration

Version 2Sign in to save

Complete solution

Shows how to fix error when creating new Prisma migration. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

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.

Steps

  1. 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.
  2. 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.

When to use

You are seeing this: 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. Use this skill when you run into "Error when creating new Prisma migration".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

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.

Edge cases

  • 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 2 · 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>

Error when creating new Prisma migration | Vectle