Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

VT10001: foreign key constraints are not allowed #233

Open
pwnllc opened this issue Oct 10, 2023 · 2 comments 路 May be fixed by #249
Open

VT10001: foreign key constraints are not allowed #233

pwnllc opened this issue Oct 10, 2023 · 2 comments 路 May be fixed by #249

Comments

@pwnllc
Copy link

pwnllc commented Oct 10, 2023

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 TABLE accountsADD CONSTRAINTaccounts_userId_fkey FOREIGN KEY (userId) REFERENCES users(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;`

@pwnllc pwnllc closed this as completed Oct 10, 2023
@pwnllc pwnllc reopened this Oct 10, 2023
@sheninthjr sheninthjr linked a pull request Nov 27, 2023 that will close this issue
@soobinJung
Copy link

I am working on resolving the same issue. 馃槄

@ddacot
Copy link

ddacot commented Feb 19, 2024

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants