Commit a82c6796 authored by Leo Gordon's avatar Leo Gordon
Browse files

patch-of-a-patch: making sure foreign key between targets and rules is added

parent b56fbc1c
......@@ -46,6 +46,9 @@ CREATE TABLE dataflow_target (
UNIQUE KEY (source_dataflow_rule_id, on_condition, input_id_template(512), to_analysis_url)
) COLLATE=latin1_swedish_ci ENGINE=InnoDB;
-- adding a foreign key between targets and rules:
ALTER TABLE dataflow_target ADD FOREIGN KEY (source_dataflow_rule_id) REFERENCES dataflow_rule(dataflow_rule_id);
-- transferring the data:
INSERT INTO dataflow_target (source_dataflow_rule_id, on_condition, input_id_template, to_analysis_url)
SELECT dataflow_rule_id, NULL, input_id_template, to_analysis_url FROM dataflow_rule;
......
......@@ -37,6 +37,9 @@ CREATE TABLE dataflow_target (
UNIQUE (source_dataflow_rule_id, on_condition, input_id_template, to_analysis_url)
);
-- adding a foreign key between targets and rules:
ALTER TABLE dataflow_target ADD FOREIGN KEY (source_dataflow_rule_id) REFERENCES dataflow_rule(dataflow_rule_id);
-- transferring the data:
INSERT INTO dataflow_target (source_dataflow_rule_id, on_condition, input_id_template, to_analysis_url)
SELECT dataflow_rule_id, NULL, input_id_template, to_analysis_url FROM dataflow_rule;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment