Drizzle Foreign Key Constraints are not allowed
Can anyone lend me a hand with understanding this error message?
I've got some relations in my schema that are causing the following error on db:push to planetscale:
Using the stock drizzle config:
Solution:Jump to solution
https://planetscale.com/blog/working-with-related-data-using-drizzle-and-planetscale looks like the one, trying it now
Emulating foreign key constraints with Drizzle relationships — Plan...
Learn how to build virtual relationships between tables in PlanetScale while using the Drizzle TypeScript ORM.
4 Replies
Relations in my schema in question, for example each episode has a mix:
or a many to many between albums and episodes
Assuming I'm either missing something in my config, or defining the relations incorrectly
Solution
https://planetscale.com/blog/working-with-related-data-using-drizzle-and-planetscale looks like the one, trying it now
Emulating foreign key constraints with Drizzle relationships — Plan...
Learn how to build virtual relationships between tables in PlanetScale while using the Drizzle TypeScript ORM.
If you use the MySQL 2 driver you need to set drizzle to emulate forgien keys
i think this works correctly now but will have to see, it pushed up at least