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;`
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 CONSTRAINT
accounts_userId_fkeyFOREIGN KEY (
userId) REFERENCES
users(
id`) ON DELETE CASCADE ON UPDATE CASCADE;ALTER TABLE
sessions
ADD CONSTRAINTsessions_userId_fkey
FOREIGN KEY (userId
) REFERENCESusers
(id
) ON DELETE CASCADE ON UPDATE CASCADE;ALTER TABLE
posts
ADD CONSTRAINTposts_authorId_fkey
FOREIGN KEY (authorId
) REFERENCESusers
(id
) ON DELETE RESTRICT ON UPDATE CASCADE;`