mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 16:54:06 +02:00
schema/pgsql: add job tables
This commit is contained in:
parent
b4a0baa109
commit
b40e1af5e8
34
schema/pgsql-migrations/upgrade_94.sql
Normal file
34
schema/pgsql-migrations/upgrade_94.sql
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
CREATE TABLE director_job (
|
||||||
|
id serial,
|
||||||
|
job_name character varying(64) NOT NULL,
|
||||||
|
job_class character varying(72) NOT NULL,
|
||||||
|
disabled enum_boolean NOT NULL DEFAULT 'n',
|
||||||
|
run_interval integer NOT NULL, -- seconds
|
||||||
|
last_attempt_succeeded enum_boolean DEFAULT NULL,
|
||||||
|
ts_last_attempt timestamp with time zone DEFAULT NULL,
|
||||||
|
ts_last_error timestamp with time zone DEFAULT NULL,
|
||||||
|
last_error_message text NULL DEFAULT NULL,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX director_job_unique_job_name ON director_job (job_name);
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE director_job_setting (
|
||||||
|
job_id integer NOT NULL,
|
||||||
|
setting_name character varying(64) NOT NULL,
|
||||||
|
setting_value text DEFAULT NULL,
|
||||||
|
PRIMARY KEY (job_id, setting_name),
|
||||||
|
CONSTRAINT director_job_setting_job
|
||||||
|
FOREIGN KEY (job_id)
|
||||||
|
REFERENCES director_job (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE INDEX director_job_setting_job ON director_job_setting (job_id);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO director_schema_migration
|
||||||
|
(schema_version, migration_time)
|
||||||
|
VALUES (94, NOW());
|
@ -207,6 +207,37 @@ CREATE TABLE director_datafield_setting (
|
|||||||
CREATE INDEX director_datafield_datafield ON director_datafield_setting (datafield_id);
|
CREATE INDEX director_datafield_datafield ON director_datafield_setting (datafield_id);
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE director_job (
|
||||||
|
id serial,
|
||||||
|
job_name character varying(64) NOT NULL,
|
||||||
|
job_class character varying(72) NOT NULL,
|
||||||
|
disabled enum_boolean NOT NULL DEFAULT 'n',
|
||||||
|
run_interval integer NOT NULL, -- seconds
|
||||||
|
last_attempt_succeeded enum_boolean DEFAULT NULL,
|
||||||
|
ts_last_attempt timestamp with time zone DEFAULT NULL,
|
||||||
|
ts_last_error timestamp with time zone DEFAULT NULL,
|
||||||
|
last_error_message text NULL DEFAULT NULL,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX director_job_unique_job_name ON director_job (job_name);
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE director_job_setting (
|
||||||
|
job_id integer NOT NULL,
|
||||||
|
setting_name character varying(64) NOT NULL,
|
||||||
|
setting_value text DEFAULT NULL,
|
||||||
|
PRIMARY KEY (job_id, setting_name),
|
||||||
|
CONSTRAINT director_job_setting_job
|
||||||
|
FOREIGN KEY (job_id)
|
||||||
|
REFERENCES director_job (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE INDEX director_job_setting_job ON director_job_setting (job_id);
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE director_schema_migration (
|
CREATE TABLE director_schema_migration (
|
||||||
schema_version SMALLINT NOT NULL,
|
schema_version SMALLINT NOT NULL,
|
||||||
migration_time TIMESTAMP WITH TIME ZONE NOT NULL,
|
migration_time TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||||
@ -1482,4 +1513,4 @@ CREATE UNIQUE INDEX notification_inheritance ON icinga_notification_inheritance
|
|||||||
|
|
||||||
INSERT INTO director_schema_migration
|
INSERT INTO director_schema_migration
|
||||||
(schema_version, migration_time)
|
(schema_version, migration_time)
|
||||||
VALUES (93, NOW());
|
VALUES (94, NOW());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user