question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prisma Migrate: Support for configuring the shadow DB URL

See original GitHub issue

Problem

The migrate dev or migrate reset commands in Prisma Migrate require a shadow database. Prisma Migrate assumes the same credentials used for the development database can be used to create it. When using a local DBMS, this can be achieved by granting the user privileges to create new databases.

Some of our users develop on the cloud and don’t run their DBMS locally. This prevents these users from using Prisma Migrate in development unless they switch to using a local DBMS.

Solutions

We could allow users to provide a URL to a shadow database that can be used as the shadow database. Example: a user could provision two Postgres databases on Heroku, one for the development another the shadow database.

In order to do this, we’d need to enable a way to supply this configuration, i.e., config file, env variable, etc.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:50
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

10reactions
albertoperdomocommented, Jan 19, 2021

@perryraskin Unfortunately not, but hopefully we can release it in 2.16.0. Thanks for your patience while we figure out the best solution.

3reactions
albertoperdomocommented, Feb 16, 2021

This feature is now live in 2.17.0 - https://github.com/prisma/prisma/releases/tag/2.17.0

For feedback, please post on https://github.com/prisma/prisma/issues/4531.

Read more comments on GitHub >

github_iconTop Results From Across the Web

About the shadow database - Prisma
Creates a fresh copy of the shadow database (or performs a soft reset if the shadow database is cloud-hosted); Reruns the current migration...
Read more >
Prisma Migrate | Database, Schema, SQL Migration Tool
Prisma Migrate is a database migration tool available via the Prisma CLI that integrates with Prisma schema for data modeling.
Read more >
Developing with Prisma Migrate
Configure the shadow database. In a development environment only, Prisma Migrate uses a temporary shadow database to perform tasks such as detecting schema ......
Read more >
Prisma Migrate in development and production
This command: Reruns the existing migration history in the shadow database in order to detect schema drift (edited or deleted migration file, or...
Read more >
Data sources (Reference) - Prisma
Programmatically override a data source url when creating your PrismaClient · Specify a different URL for Prisma Migrate's shadow database if you are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found