shadcn-ui / taxonomy

An open source application built using the new router, server components and everything new in Next.js 13.
https://tx.shadcn.com
MIT License
18.01k stars 2.48k forks source link

VT10001: foreign key constraints are not allowed #233

Open pwnllc opened 9 months ago

pwnllc commented 9 months ago

Hello, Another day, another issue😅... When I try to insert the sql queries into the planetscale db, I get the following error: VT10001: foreign key constraints are not allowed

Query: ALTER TABLEaccountsADD CONSTRAINTaccounts_userId_fkeyFOREIGN KEY (userId) REFERENCESusers(id`) ON DELETE CASCADE ON UPDATE CASCADE;

ALTER TABLE sessions ADD CONSTRAINT sessions_userId_fkey FOREIGN KEY (userId) REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE;

ALTER TABLE posts ADD CONSTRAINT posts_authorId_fkey FOREIGN KEY (authorId) REFERENCES users(id) ON DELETE RESTRICT ON UPDATE CASCADE;`

soobinJung commented 4 months ago

I am working on resolving the same issue. 😅

ddacot commented 4 months ago

@soobinJung you should be able to enable Foreign Keys on Planetscale website now.

https://planetscale.com/blog/announcing-foreign-key-constraints-support