mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
Add imports support for Timeperiod
This commit is contained in:
parent
f7bd670d1b
commit
0af3ed4452
@ -48,5 +48,10 @@ class IcingaTimePeriodForm extends DirectorObjectForm
|
|||||||
'description' => $this->translate('Check this host in this specific Icinga cluster zone'),
|
'description' => $this->translate('Check this host in this specific Icinga cluster zone'),
|
||||||
'required' => true
|
'required' => true
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$this->addElement('text', 'imports', array(
|
||||||
|
'label' => $this->translate('Imports'),
|
||||||
|
'description' => $this->translate('The inherited timperiods template names')
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,6 @@ class IcingaTimePeriod extends IcingaObject
|
|||||||
'update_method' => null,
|
'update_method' => null,
|
||||||
'object_type' => null,
|
'object_type' => null,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
protected $supportsImports = true;
|
||||||
}
|
}
|
||||||
|
17
schema/mysql-changes/upgrade_14.sql
Normal file
17
schema/mysql-changes/upgrade_14.sql
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
CREATE TABLE icinga_timeperiod_inheritance (
|
||||||
|
timeperiod_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
parent_timeperiod_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
weight MEDIUMINT UNSIGNED DEFAULT NULL,
|
||||||
|
PRIMARY KEY (timeperiod_id, parent_timeperiod_id),
|
||||||
|
UNIQUE KEY unique_order (timeperiod_id, weight),
|
||||||
|
CONSTRAINT icinga_timeperiod_inheritance_timeperiod
|
||||||
|
FOREIGN KEY host (timeperiod_id)
|
||||||
|
REFERENCES icinga_timeperiod (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_timeperiod_inheritance_parent_timeperiod
|
||||||
|
FOREIGN KEY host (parent_timeperiod_id)
|
||||||
|
REFERENCES icinga_timeperiod (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
@ -152,6 +152,24 @@ CREATE TABLE icinga_timeperiod (
|
|||||||
ON UPDATE CASCADE
|
ON UPDATE CASCADE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE icinga_timeperiod_inheritance (
|
||||||
|
timeperiod_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
parent_timeperiod_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
weight MEDIUMINT UNSIGNED DEFAULT NULL,
|
||||||
|
PRIMARY KEY (timeperiod_id, parent_timeperiod_id),
|
||||||
|
UNIQUE KEY unique_order (timeperiod_id, weight),
|
||||||
|
CONSTRAINT icinga_timeperiod_inheritance_timeperiod
|
||||||
|
FOREIGN KEY host (timeperiod_id)
|
||||||
|
REFERENCES icinga_timeperiod (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_timeperiod_inheritance_parent_timeperiod
|
||||||
|
FOREIGN KEY host (parent_timeperiod_id)
|
||||||
|
REFERENCES icinga_timeperiod (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
CREATE TABLE icinga_timeperiod_range (
|
CREATE TABLE icinga_timeperiod_range (
|
||||||
timeperiod_id INT(10) UNSIGNED AUTO_INCREMENT NOT NULL,
|
timeperiod_id INT(10) UNSIGNED AUTO_INCREMENT NOT NULL,
|
||||||
timeperiod_key VARCHAR(255) NOT NULL COMMENT 'monday, ...',
|
timeperiod_key VARCHAR(255) NOT NULL COMMENT 'monday, ...',
|
||||||
|
20
schema/pgsql-changes/upgrade-5.sql
Normal file
20
schema/pgsql-changes/upgrade-5.sql
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
CREATE TABLE icinga_timeperiod_inheritance (
|
||||||
|
timeperiod_id integer NOT NULL,
|
||||||
|
parent_timeperiod_id integer NOT NULL,
|
||||||
|
weight integer DEFAULT NULL,
|
||||||
|
PRIMARY KEY (timeperiod_id, parent_timeperiod_id),
|
||||||
|
CONSTRAINT icinga_timeperiod_inheritance_timeperiodr
|
||||||
|
FOREIGN KEY (timeperiod_id)
|
||||||
|
REFERENCES icinga_timeperiod (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_timeperiod_inheritance_parent_timeperiod
|
||||||
|
FOREIGN KEY (parent_timeperiod_id)
|
||||||
|
REFERENCES icinga_timeperiod (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX timeperiod_inheritance_unique_order ON icinga_timeperiod_inheritance (timeperiod_id, weight);
|
||||||
|
CREATE INDEX timeperiod_inheritance_timeperiod ON icinga_timeperiod_inheritance (timeperiod_id);
|
||||||
|
CREATE INDEX timeperiod_inheritance_timeperiod_parent ON icinga_timeperiod_inheritance (parent_timeperiod_id);
|
@ -197,6 +197,28 @@ CREATE INDEX timeperiod_zone ON icinga_timeperiod (zone_id);
|
|||||||
COMMENT ON COLUMN icinga_timeperiod.update_method IS 'Usually LegacyTimePeriod';
|
COMMENT ON COLUMN icinga_timeperiod.update_method IS 'Usually LegacyTimePeriod';
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE icinga_timeperiod_inheritance (
|
||||||
|
timeperiod_id integer NOT NULL,
|
||||||
|
parent_timeperiod_id integer NOT NULL,
|
||||||
|
weight integer DEFAULT NULL,
|
||||||
|
PRIMARY KEY (timeperiod_id, parent_timeperiod_id),
|
||||||
|
CONSTRAINT icinga_timeperiod_inheritance_timeperiodr
|
||||||
|
FOREIGN KEY (timeperiod_id)
|
||||||
|
REFERENCES icinga_timeperiod (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_timeperiod_inheritance_parent_timeperiod
|
||||||
|
FOREIGN KEY (parent_timeperiod_id)
|
||||||
|
REFERENCES icinga_timeperiod (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX timeperiod_inheritance_unique_order ON icinga_timeperiod_inheritance (timeperiod_id, weight);
|
||||||
|
CREATE INDEX timeperiod_inheritance_timeperiod ON icinga_timeperiod_inheritance (timeperiod_id);
|
||||||
|
CREATE INDEX timeperiod_inheritance_timeperiod_parent ON icinga_timeperiod_inheritance (parent_timeperiod_id);
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE icinga_timeperiod_range (
|
CREATE TABLE icinga_timeperiod_range (
|
||||||
timeperiod_id serial,
|
timeperiod_id serial,
|
||||||
timeperiod_key character varying(255) NOT NULL,
|
timeperiod_key character varying(255) NOT NULL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user