Open pdestefanis opened 12 years ago
Currently, when a form or incident is deleted, its custom form-related records are orphaned. Could we implement FK's to deal wiht them?
What I believe is needed:
Convert the following tables to InnoDB:
incident form form_field form_field_option form_response
ALTER TABLE form_field ADD CONSTRAINT FK_form_id FOREIGN KEY FK_form_field_1 (form_id) REFERENCES form (id) ON DELETE CASCADE ON UPDATE CASCADE , ROW_FORMAT = DYNAMIC;
form_field
FK_form_id
FK_form_field_1
form_id
form
id
ALTER TABLE form_response ADD CONSTRAINT FK_incident FOREIGN KEY FK_form_response_2 (incident_id) REFERENCES incident (id) ON DELETE CASCADE ON UPDATE CASCADE , ROW_FORMAT = DYNAMIC;
form_response
FK_incident
FK_form_response_2
incident_id
incident
ALTER TABLE form_responseADD CONSTRAINTFK_form_fieldFOREIGN KEYFK_form_response_1(form_field_id) REFERENCESform_field(id`) ON DELETE CASCADE ON UPDATE CASCADE , ROW_FORMAT = DYNAMIC;
ADD CONSTRAINT
FOREIGN KEY
(
) REFERENCES
ALTER TABLE form_field_option ADD CONSTRAINT FK_form_field_option_1 FOREIGN KEY FK_form_field_option_1 (form_field_id) REFERENCES form_field (id) ON DELETE CASCADE ON UPDATE CASCADE , ROW_FORMAT = DYNAMIC;
form_field_option
FK_form_field_option_1
form_field_id
Better way of handling custom forms is a key feature on 3.0.
Currently, when a form or incident is deleted, its custom form-related records are orphaned. Could we implement FK's to deal wiht them?
What I believe is needed:
Convert the following tables to InnoDB:
incident form form_field form_field_option form_response
ALTER TABLE
form_field
ADD CONSTRAINTFK_form_id
FOREIGN KEYFK_form_field_1
(form_id
) REFERENCESform
(id
) ON DELETE CASCADE ON UPDATE CASCADE , ROW_FORMAT = DYNAMIC;ALTER TABLE
form_response
ADD CONSTRAINTFK_incident
FOREIGN KEYFK_form_response_2
(incident_id
) REFERENCESincident
(id
) ON DELETE CASCADE ON UPDATE CASCADE , ROW_FORMAT = DYNAMIC;ALTER TABLE form_response
ADD CONSTRAINT
FK_form_fieldFOREIGN KEY
FK_form_response_1(
form_field_id) REFERENCES
form_field(
id`) ON DELETE CASCADE ON UPDATE CASCADE , ROW_FORMAT = DYNAMIC;ALTER TABLE
form_field_option
ADD CONSTRAINTFK_form_field_option_1
FOREIGN KEYFK_form_field_option_1
(form_field_id
) REFERENCESform_field
(id
) ON DELETE CASCADE ON UPDATE CASCADE , ROW_FORMAT = DYNAMIC;