Foreign key constraint prevent deleting mailing lists

Description

Trying to delete a mailing list that is still subscribed end in a integrity constraint violation.

Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`db373081_38`.`orm_avisota_subscription`, CONSTRAINT `FK_6B396A3D7B1AC3ED` FOREIGN KEY (`mailingList`) REFERENCES `orm_avisota_mailing_list` (`id`))

I'm not sure if the right way is just adding a cascade or checking if someone has subscribed the list and disable the delete button.

Maybe the best way is to ask the user in this case and perform a deep deletion.

Status

Assignee

Unassigned

Reporter

Tristan Lins

Labels

Affected Contao CMS versions

Sprint

Affects versions

Priority

Major
Configure