mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 08:44:11 +02:00
schema: add notification assignment tables
This commit is contained in:
parent
7209f162b2
commit
247ef41483
15
schema/mysql-migrations/upgrade_85.sql
Normal file
15
schema/mysql-migrations/upgrade_85.sql
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
CREATE TABLE icinga_notification_assignment (
|
||||||
|
id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
notification_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
filter_string TEXT NOT NULL,
|
||||||
|
PRIMARY KEY (id),
|
||||||
|
CONSTRAINT icinga_notification_assignment
|
||||||
|
FOREIGN KEY notification (notification_id)
|
||||||
|
REFERENCES icinga_notification (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
INSERT INTO director_schema_migration
|
||||||
|
(schema_version, migration_time)
|
||||||
|
VALUES (85, NOW());
|
@ -1029,6 +1029,18 @@ CREATE TABLE icinga_notification_types_set (
|
|||||||
ON UPDATE CASCADE
|
ON UPDATE CASCADE
|
||||||
) ENGINE=InnoDB;
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
CREATE TABLE icinga_notification_assignment (
|
||||||
|
id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
notification_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
filter_string TEXT NOT NULL,
|
||||||
|
PRIMARY KEY (id),
|
||||||
|
CONSTRAINT icinga_notification_assignment
|
||||||
|
FOREIGN KEY notification (notification_id)
|
||||||
|
REFERENCES icinga_notification (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
CREATE TABLE import_source (
|
CREATE TABLE import_source (
|
||||||
id INT(10) UNSIGNED AUTO_INCREMENT NOT NULL,
|
id INT(10) UNSIGNED AUTO_INCREMENT NOT NULL,
|
||||||
source_name VARCHAR(64) NOT NULL,
|
source_name VARCHAR(64) NOT NULL,
|
||||||
@ -1213,4 +1225,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 = 84;
|
schema_version = 85;
|
||||||
|
15
schema/pgsql-migrations/upgrade_85.sql
Normal file
15
schema/pgsql-migrations/upgrade_85.sql
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
CREATE TABLE icinga_notification_assignment (
|
||||||
|
id bigserial,
|
||||||
|
notification_id integer NOT NULL,
|
||||||
|
filter_string TEXT NOT NULL,
|
||||||
|
PRIMARY KEY (id),
|
||||||
|
CONSTRAINT icinga_notification_assignment
|
||||||
|
FOREIGN KEY (notification_id)
|
||||||
|
REFERENCES icinga_notification (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO director_schema_migration
|
||||||
|
(schema_version, migration_time)
|
||||||
|
VALUES (85, NOW());
|
@ -1152,6 +1152,19 @@ CREATE TABLE icinga_notification (
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE icinga_notification_assignment (
|
||||||
|
id bigserial,
|
||||||
|
notification_id integer NOT NULL,
|
||||||
|
filter_string TEXT NOT NULL,
|
||||||
|
PRIMARY KEY (id),
|
||||||
|
CONSTRAINT icinga_notification_assignment
|
||||||
|
FOREIGN KEY (notification_id)
|
||||||
|
REFERENCES icinga_notification (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE import_source (
|
CREATE TABLE import_source (
|
||||||
id serial,
|
id serial,
|
||||||
source_name character varying(64) NOT NULL,
|
source_name character varying(64) NOT NULL,
|
||||||
@ -1424,4 +1437,4 @@ CREATE UNIQUE INDEX notification_inheritance ON icinga_notification_inheritance
|
|||||||
-- set current schema version
|
-- set current schema version
|
||||||
INSERT INTO director_schema_migration
|
INSERT INTO director_schema_migration
|
||||||
(schema_version, migration_time)
|
(schema_version, migration_time)
|
||||||
VALUES (84, NOW());
|
VALUES (85, NOW());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user