mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-21 12:54: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,
|
job_class VARCHAR(72) NOT NULL,
|
||||||
disabled ENUM('y', 'n') NOT NULL DEFAULT 'n',
|
disabled ENUM('y', 'n') NOT NULL DEFAULT 'n',
|
||||||
run_interval INT(10) UNSIGNED NOT NULL, -- seconds
|
run_interval INT(10) UNSIGNED NOT NULL, -- seconds
|
||||||
|
timeperiod_id INT(10) UNSIGNED DEFAULT NULL,
|
||||||
last_attempt_succeeded ENUM('y', 'n') DEFAULT NULL,
|
last_attempt_succeeded ENUM('y', 'n') DEFAULT NULL,
|
||||||
ts_last_attempt DATETIME DEFAULT NULL,
|
ts_last_attempt DATETIME DEFAULT NULL,
|
||||||
ts_last_error DATETIME DEFAULT NULL,
|
ts_last_error DATETIME DEFAULT NULL,
|
||||||
last_error_message TEXT,
|
last_error_message TEXT,
|
||||||
PRIMARY KEY (id),
|
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;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
CREATE TABLE director_job_setting (
|
CREATE TABLE director_job_setting (
|
||||||
@ -1303,4 +1309,4 @@ CREATE TABLE sync_run (
|
|||||||
|
|
||||||
INSERT INTO director_schema_migration
|
INSERT INTO director_schema_migration
|
||||||
SET migration_time = NOW(),
|
SET migration_time = NOW(),
|
||||||
schema_version = 96;
|
schema_version = 97;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user