Removing a domain produces an SQL error
-
Hello. I'm trying to remove a domain and it's giving me the following error:
ER_ROW_IS_REFERENCED_2: Cannot delete or update a parent row: a foreign key constraint fails (
box
.mailboxes
, CONSTRAINTmailboxes_aliasDomain_constraint
FOREIGN KEY (aliasDomain
) REFERENCESmail
(domain
))There are four mailboxes connected to the domain.
Do I perhaps need to delete the mailboxes before removing the domain?
If so, feature request to put a checkbox (when deleting the domain) that will delete the mailboxes associated with it prior.
Thanks!
-
@ChicagoGregg said in Removing a domain produces an SQL error:
Do I perhaps need to delete the mailboxes before removing the domain?
Yes, indeed. You have to remove mailboxes before deleting the domain itself.
But looks like we don't handle some error properly, I am trying to reproduce this now.
If so, feature request to put a checkbox (when deleting the domain) that will delete the mailboxes associated with it prior.
This will be a bit complicated because you have to also decide whether to keep the mails in each mailbox. When you delete a mailbox, the option to keep the data or not is provided as a checkbox.
-
-
-
@girish said in Removing a domain produces an SQL error:
This will be a bit complicated because you have to also decide whether to keep the mails in each mailbox. When you delete a mailbox, the option to keep the data or not is provided as a checkbox.
Yea, it's a little more detailed for a new feature. How often is a domain deleted anyways. Well, it's a "nice to have". Low of the totem pole.
@girish said in Removing a domain produces an SQL error:
This for reporting, I could reproduce this. Fixed in https://git.cloudron.io/cloudron/box/-/commit/ba16fdaf603d664ca818dd084e6eb0315a3168a0
Sure thing. Glad to have helped.
Thanks,
-gregg
-
@ChicagoGregg said in Removing a domain produces an SQL error:
Low of the totem pole.
Low of the totem pole.Just use "least significant/important/crucial".