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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document MySQL < 8 / MariaDB < 10.3 does not support the referential action onDelete: setDefault #3885

Closed
Jolg42 opened this issue Oct 12, 2022 · 1 comment · Fixed by #4132
Assignees
Labels
docs Documentation creation, updates or corrections topic: referential actions
Milestone

Comments

@Jolg42
Copy link
Member

Jolg42 commented Oct 12, 2022

Based on prisma/prisma#11498

MySQL < 8 / MariaDB < 10.3 (not 100% sure for that version) does not support the referential action onDelete: setDefault

It errors with Error: Cannot add foreign key constraint.

TODO:

@Jolg42
Copy link
Member Author

Jolg42 commented Nov 3, 2022

    I have just found out that `MySQL 8.0` [docs](https://dev.mysql.com/doc/refman/8.0/en/create-table-foreign-keys.html#foreign-key-referential-actions) report the following:

SET DEFAULT: This action is recognized by the MySQL parser, but both InnoDB and NDB reject table definitions containing ON DELETE SET DEFAULT or ON UPDATE SET DEFAULT clauses.

Originally posted by @jkomyno in prisma/prisma#11498 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation creation, updates or corrections topic: referential actions
Projects
None yet
2 participants