ForeignKeyCascadeChecker default mapping
pyromaniac opened this issue · 3 comments
pyromaniac commented
Hey @djezzzl I believe that the mapping here
Accordingly to https://stackoverflow.com/questions/60043008/when-to-use-nothing-or-restrict-for-on-delete-with-ecto the default NO ACTION value also raises an error, it is just deferred. But for this purpose it would be perfect to have something like:
OPTION_TO_CASCADE = {
delete: :cascade,
delete_all: :cascade,
nullify: :nullify,
restrict_with_exception: [nil, :restrict],
restrict_with_error: [nil, :restrict]
}.freeze
WDYT?
djezzzl commented
Hi @pyromaniac,
Yes, it seems you're correct. Thank you for sharing this! Would you like to make a PR for that?
I'm sorry it took me long to look at the issue.
pyromaniac commented
Yes, will do soon
djezzzl commented
Thank you! I would be happy to merge and release immediately.