Hi please does anyone know how to use Prisma with ...
# orm-help
n
Hi please does anyone know how to use Prisma with Heroku Postgres? It just doesn't seem to be working.
prisma migrate dev
doesn't work
m
What’s the error message you get?
n
@Michael Fernandez Prisma Migrate could not create the shadow database
m
That’s the only thing in the error message? There is nowhere in the stack trace that says “permission denied to create database”?
n
@Michael Fernandez thanks There are just so many GitHub issues threads regarding this. It's hard to just get a simple solution. I wish Prisma just has a guide to using heroku Postgres
r
@Nathaniel Babalola 👋 You need to have a separate database for migrations as a shadow database, without that migrations in Heroku will not work. Have a look at this section in the docs for more info 🙂
👍 1
n
Thanks @Ryan , so when Prisma is creating migrations when I'm working locally....it creates for both Database_url and Shadow_database_url ?
r
Shadow database is only a temporary database used by Migrate to apply migrations to the main database. It needs that shadow DB to compare and check if there were any drifts in migrations against your actual database. It is discarded after migrations are applied.
n
Which one of these will be your local DB and which one will be Heroku Postgres? @Ryan. And how will these work for different DBs for dev, staging and prod.
r
Staging and prod don’t need a shadow database. You can use
prisma migrate deploy
on staging and prod to apply migrations.
n
Ooh okay I get, thanks @Ryan
💯 1