schema: relax choice constraint for delete
This commit is contained in:
parent
ceebe08ecd
commit
303b8776a2
|
@ -0,0 +1,19 @@
|
||||||
|
ALTER TABLE icinga_host
|
||||||
|
DROP FOREIGN KEY icinga_host_template_choice,
|
||||||
|
ADD CONSTRAINT icinga_host_template_choice_v2
|
||||||
|
FOREIGN KEY template_choice (template_choice_id)
|
||||||
|
REFERENCES icinga_host_template_choice (id)
|
||||||
|
ON DELETE SET NULL
|
||||||
|
ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
ALTER TABLE icinga_service
|
||||||
|
DROP FOREIGN KEY icinga_service_template_choice,
|
||||||
|
ADD CONSTRAINT icinga_service_template_choice_v2
|
||||||
|
FOREIGN KEY template_choice (template_choice_id)
|
||||||
|
REFERENCES icinga_service_template_choice (id)
|
||||||
|
ON DELETE SET NULL
|
||||||
|
ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
INSERT INTO director_schema_migration
|
||||||
|
(schema_version, migration_time)
|
||||||
|
VALUES (134, NOW());
|
|
@ -497,7 +497,7 @@ CREATE TABLE icinga_host (
|
||||||
CONSTRAINT icinga_host_template_choice
|
CONSTRAINT icinga_host_template_choice
|
||||||
FOREIGN KEY choice (template_choice_id)
|
FOREIGN KEY choice (template_choice_id)
|
||||||
REFERENCES icinga_host_template_choice (id)
|
REFERENCES icinga_host_template_choice (id)
|
||||||
ON DELETE RESTRICT
|
ON DELETE SET NULL
|
||||||
ON UPDATE CASCADE
|
ON UPDATE CASCADE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
@ -653,7 +653,7 @@ CREATE TABLE icinga_service (
|
||||||
CONSTRAINT icinga_service_template_choice
|
CONSTRAINT icinga_service_template_choice
|
||||||
FOREIGN KEY choice (template_choice_id)
|
FOREIGN KEY choice (template_choice_id)
|
||||||
REFERENCES icinga_service_template_choice (id)
|
REFERENCES icinga_service_template_choice (id)
|
||||||
ON DELETE RESTRICT
|
ON DELETE SET NULL
|
||||||
ON UPDATE CASCADE
|
ON UPDATE CASCADE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
@ -1556,4 +1556,4 @@ CREATE TABLE icinga_user_resolved_var (
|
||||||
|
|
||||||
INSERT INTO director_schema_migration
|
INSERT INTO director_schema_migration
|
||||||
(schema_version, migration_time)
|
(schema_version, migration_time)
|
||||||
VALUES (133, NOW());
|
VALUES (134, NOW());
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
ALTER TABLE icinga_host
|
||||||
|
DROP CONSTRAINT icinga_host_template_choice,
|
||||||
|
ADD CONSTRAINT icinga_host_template_choice_v2
|
||||||
|
FOREIGN KEY (template_choice_id)
|
||||||
|
REFERENCES icinga_host_template_choice (id)
|
||||||
|
ON DELETE SET NULL
|
||||||
|
ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
ALTER TABLE icinga_service
|
||||||
|
DROP CONSTRAINT icinga_service_template_choice,
|
||||||
|
ADD CONSTRAINT icinga_service_template_choice_v2
|
||||||
|
FOREIGN KEY (template_choice_id)
|
||||||
|
REFERENCES icinga_service_template_choice (id)
|
||||||
|
ON DELETE SET NULL
|
||||||
|
ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
INSERT INTO director_schema_migration
|
||||||
|
(schema_version, migration_time)
|
||||||
|
VALUES (134, NOW());
|
|
@ -618,7 +618,7 @@ CREATE TABLE icinga_host (
|
||||||
CONSTRAINT icinga_host_template_choice
|
CONSTRAINT icinga_host_template_choice
|
||||||
FOREIGN KEY (template_choice_id)
|
FOREIGN KEY (template_choice_id)
|
||||||
REFERENCES icinga_host_template_choice (id)
|
REFERENCES icinga_host_template_choice (id)
|
||||||
ON DELETE RESTRICT
|
ON DELETE SET NULL
|
||||||
ON UPDATE CASCADE
|
ON UPDATE CASCADE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -803,7 +803,7 @@ CREATE TABLE icinga_service (
|
||||||
CONSTRAINT icinga_service_template_choice
|
CONSTRAINT icinga_service_template_choice
|
||||||
FOREIGN KEY (template_choice_id)
|
FOREIGN KEY (template_choice_id)
|
||||||
REFERENCES icinga_service_template_choice (id)
|
REFERENCES icinga_service_template_choice (id)
|
||||||
ON DELETE RESTRICT
|
ON DELETE SET NULL
|
||||||
ON UPDATE CASCADE
|
ON UPDATE CASCADE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1833,4 +1833,4 @@ CREATE INDEX user_resolved_var_schecksum ON icinga_user_resolved_var (checksum);
|
||||||
|
|
||||||
INSERT INTO director_schema_migration
|
INSERT INTO director_schema_migration
|
||||||
(schema_version, migration_time)
|
(schema_version, migration_time)
|
||||||
VALUES (133, NOW());
|
VALUES (134, NOW());
|
||||||
|
|
Loading…
Reference in New Issue