mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-20 20:34:26 +02:00
schema/mysql: add timeperiod support for jobs
This commit is contained in:
parent
f6a9e3b149
commit
9c31a51a18
11
schema/mysql-migrations/upgrade_97.sql
Normal file
11
schema/mysql-migrations/upgrade_97.sql
Normal file
@ -0,0 +1,11 @@
|
||||
ALTER TABLE director_job
|
||||
ADD COLUMN timeperiod_id INT(10) UNSIGNED DEFAULT NULL AFTER run_interval,
|
||||
ADD CONSTRAINT director_job_period
|
||||
FOREIGN KEY timeperiod (timeperiod_id)
|
||||
REFERENCES icinga_timeperiod (id)
|
||||
ON DELETE RESTRICT
|
||||
ON UPDATE CASCADE;
|
||||
|
||||
INSERT INTO director_schema_migration
|
||||
(schema_version, migration_time)
|
||||
VALUES (97, NOW());
|
@ -146,12 +146,18 @@ CREATE TABLE director_job (
|
||||
job_class VARCHAR(72) NOT NULL,
|
||||
disabled ENUM('y', 'n') NOT NULL DEFAULT 'n',
|
||||
run_interval INT(10) UNSIGNED NOT NULL, -- seconds
|
||||
timeperiod_id INT(10) UNSIGNED DEFAULT NULL,
|
||||
last_attempt_succeeded ENUM('y', 'n') DEFAULT NULL,
|
||||
ts_last_attempt DATETIME DEFAULT NULL,
|
||||
ts_last_error DATETIME DEFAULT NULL,
|
||||
last_error_message TEXT,
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY (job_name)
|
||||
UNIQUE KEY (job_name),
|
||||
CONSTRAINT director_job_period
|
||||
FOREIGN KEY timeperiod (timeperiod_id)
|
||||
REFERENCES icinga_timeperiod (id)
|
||||
ON DELETE RESTRICT
|
||||
ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE director_job_setting (
|
||||
@ -1303,4 +1309,4 @@ CREATE TABLE sync_run (
|
||||
|
||||
INSERT INTO director_schema_migration
|
||||
SET migration_time = NOW(),
|
||||
schema_version = 96;
|
||||
schema_version = 97;
|
||||
|
Loading…
x
Reference in New Issue
Block a user