Is there a way to set up a `@relation` without cre...
# prisma-migrate
p
Is there a way to set up a
@relation
without creating foreign key constraints in the database(mysql)? When I do
prisma db push
, the foreign key constraint is not created, but
prisma migrate dev
tries to create it. In typeorm
Copy code
@ManyToOne(type => Person, {
  createForeignKeyConstraints: false
})
I’m looking for an option similar to this.
j
No, that does not exist yet.
db push
should in theory also create the foreign keys to be honest...
I created a speculative bug report about this: https://github.com/prisma/prisma/issues/7722
For your actual question: Can you tell us a bit more why you want to do it this way?
We have these two feature requests which are related to what you are asking: https://github.com/prisma/prisma/issues/7293 https://github.com/prisma/prisma/issues/7351 The second one sounds pretty much what you need I think.
Maybe leave your use case as a comment there - right now it is only 1 random opinion.
p
I’ll leave a comment about the bug you created and why I need it on an existing issue. Thanks for answering my question
👍 1