mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2026-05-28 04:35:53 -04:00
schema/mysql: introduce icinga_service.host_id
This commit is contained in:
parent
5091db2268
commit
46ce190813
2 changed files with 16 additions and 0 deletions
9
schema/mysql-changes/upgrade_53.sql
Normal file
9
schema/mysql-changes/upgrade_53.sql
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
ALTER TABLE icinga_service
|
||||
ADD COLUMN host_id INT(10) UNSIGNED DEFAULT NULL AFTER display_name,
|
||||
ADD UNIQUE KEY object_key (object_name, host_id),
|
||||
ADD CONSTRAINT icinga_host
|
||||
FOREIGN KEY host (host_id)
|
||||
REFERENCES icinga_host (id)
|
||||
ON DELETE SET NULL
|
||||
ON UPDATE CASCADE;
|
||||
|
||||
|
|
@ -464,6 +464,7 @@ CREATE TABLE icinga_service (
|
|||
id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
object_name VARCHAR(255) NOT NULL,
|
||||
display_name VARCHAR(255) DEFAULT NULL,
|
||||
host_id INT(10) UNSIGNED DEFAULT NULL,
|
||||
check_command_id INT(10) UNSIGNED DEFAULT NULL,
|
||||
max_check_attempts MEDIUMINT UNSIGNED DEFAULT NULL,
|
||||
check_period_id INT(10) UNSIGNED DEFAULT NULL,
|
||||
|
|
@ -488,6 +489,12 @@ CREATE TABLE icinga_service (
|
|||
object_type ENUM('object', 'template', 'apply') NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
-- UNIQUE INDEX object_name (object_name, zone_id),
|
||||
UNIQUE KEY object_key (object_name, host_id),
|
||||
CONSTRAINT icinga_host
|
||||
FOREIGN KEY host (host_id)
|
||||
REFERENCES icinga_host (id)
|
||||
ON DELETE SET NULL
|
||||
ON UPDATE CASCADE,
|
||||
CONSTRAINT icinga_service_zone
|
||||
FOREIGN KEY zone (zone_id)
|
||||
REFERENCES icinga_zone (id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue