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

Model options overwrite association options #11056

Open
Celadora opened this issue Jun 11, 2019 · 2 comments
Open

Model options overwrite association options #11056

Celadora opened this issue Jun 11, 2019 · 2 comments
Labels
status: awaiting response For issues and PRs. OP must respond (or change something, if it is a PR). Maintainers have no action type: docs For issues and PRs. Things related to documentation, such as changes in the manuals / API reference.

Comments

@Celadora
Copy link

What was unclear/insufficient/not covered in the documentation

Options at time of model definition take priority over options provided when associating models.

For example, if some associations require the onDelete: 'SET NULL' option, and others require the onDelete: 'NO ACTION' option, then you cannot set onDelete: 'CASCADE' on the model's options and expect the associations options to be respected.

If possible: Provide some suggestion how we can enhance the docs

Model definition options (e.g. onDelete and onUpdate) will replace model association options.

@Celadora Celadora added the type: docs For issues and PRs. Things related to documentation, such as changes in the manuals / API reference. label Jun 11, 2019
@papb
Copy link
Member

papb commented Aug 1, 2019

Hi, thanks for this issue, can you expand a bit on your suggestion?

For example, if some associations require the onDelete: 'SET NULL' option, and others require the onDelete: 'NO ACTION' option, then you cannot set onDelete: 'CASCADE' on the model's options and expect the associations options to be respected.

Can you show some code to demonstrate this? Thank you in advance!

@papb papb added the status: awaiting response For issues and PRs. OP must respond (or change something, if it is a PR). Maintainers have no action label Aug 1, 2019
@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2021

This issue has been automatically marked as stale because it has been open for 14 days without activity. It will be closed if no further activity occurs within the next 14 days. If this is still an issue, just leave a comment or remove the "stale" label. 🙂

@github-actions github-actions bot added the stale label Nov 9, 2021
@WikiRik WikiRik removed the stale label Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: awaiting response For issues and PRs. OP must respond (or change something, if it is a PR). Maintainers have no action type: docs For issues and PRs. Things related to documentation, such as changes in the manuals / API reference.
Projects
None yet
Development

No branches or pull requests

3 participants