-
I am using planetscale and I am trying to create new migrations. I created 2 branches one feature and other shadow. I yarn run v1.22.10
$ /Users/saihajpreetsingh/Desktop/scribedao/retweet/node_modules/.bin/prisma migrate dev
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": MySQL database "scribedao-prod" at "hbr7v1ewleao.us-east-3.psdb.cloud:3306"
Error: P3006
Migration `20210907234126_` failed to apply cleanly to the shadow database.
Error code: P3018
Error:
A migration failed to apply. New migrations cannot be applied before the error is recovered from. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve
Migration name: 20210907234126_
Database error code: 1317
Database error:
Foreign keys cannot be created on this database. Learn more how to handle this: https://pris.ly/d/migrate-no-foreign-keys
Please check the query number 8 from the migration file.
Prisma version:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@saihaj 👋 Currently we don't recommend using The best way to go for now is using |
Beta Was this translation helpful? Give feedback.
@saihaj 👋
Currently we don't recommend using
prisma migrate
on Planetscale. Also it seems that you are using foreign keys and Planetscale doesn't support that. The way to tell migrate not to create foreign keys is adding thereferentialIntegrity
preview feature and usingreferentialIntegrity = "prisma"
in the datasource that you can read about here.The best way to go for now is using
db push
when using PlanetScale and not using foreign keys.