Description
Describe the bug
I had a matching table resource with a has_many to timeslots, and wanted to delete those if the matching table got remove. So I added the following to matching table:
references do
reference :timeslots, on_delete: :delete
end
Turns out you need to do it on the belongs_to but this didnt give any warnings when generating migrations just that there werent any changes. I dont know if its possible to add a warning but would imo be a nice change
To Reproduce
Create two resources, one with a has_many and the other with a belongs_to. Then add a delete reference to the one with the has_many relationship and try to generate migrations.
Expected behavior
I would expect either an error or warning saying that this reference is useless and a suggestion to put it on the belongs_to resource.
** Runtime
[ - Elixir version](elixir: "> 1.16",)> 3.4.37"},
{:ash, "
{:ash_postgres, "> 2.4.12"},> 2.0"},
{:ash_phoenix, "
{:ash_admin, "> 0.11.9"},> 4.2.7"},
{:ash_authentication, "
{:ash_authentication_phoenix, "~> 2.1.2"},
Metadata
Metadata
Assignees
Labels
Type
Projects
Status