summaryrefslogtreecommitdiffstats
path: root/schema
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:17:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:17:48 +0000
commite6d4dfc040bbe3cb80a2ce65b82493b557f751fc (patch)
tree40bd6366b01b06f4d96fc8638f23a772263cb5e9 /schema
parentReleasing progress-linux version 1.10.2-2~progress7.99u1. (diff)
downloadicingaweb2-module-director-e6d4dfc040bbe3cb80a2ce65b82493b557f751fc.tar.xz
icingaweb2-module-director-e6d4dfc040bbe3cb80a2ce65b82493b557f751fc.zip
Merging upstream version 1.11.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'schema')
-rw-r--r--schema/mysql-migrations/upgrade_183.sql9
-rw-r--r--schema/mysql-migrations/upgrade_184.sql9
-rw-r--r--schema/mysql-migrations/upgrade_186.sql35
-rw-r--r--schema/mysql-migrations/upgrade_187.sql5
-rw-r--r--schema/mysql.sql9
-rw-r--r--schema/pgsql-migrations/upgrade_183.sql9
-rw-r--r--schema/pgsql-migrations/upgrade_184.sql9
-rw-r--r--schema/pgsql-migrations/upgrade_186.sql11
-rw-r--r--schema/pgsql-migrations/upgrade_187.sql5
-rw-r--r--schema/pgsql.sql9
10 files changed, 108 insertions, 2 deletions
diff --git a/schema/mysql-migrations/upgrade_183.sql b/schema/mysql-migrations/upgrade_183.sql
new file mode 100644
index 0000000..3e9577d
--- /dev/null
+++ b/schema/mysql-migrations/upgrade_183.sql
@@ -0,0 +1,9 @@
+ALTER TABLE icinga_notification
+ ADD COLUMN users_var VARCHAR(255) DEFAULT NULL AFTER zone_id;
+
+ALTER TABLE icinga_notification
+ ADD COLUMN user_groups_var VARCHAR(255) DEFAULT NULL AFTER users_var;
+
+INSERT INTO director_schema_migration
+ (schema_version, migration_time)
+ VALUES (183, NOW());
diff --git a/schema/mysql-migrations/upgrade_184.sql b/schema/mysql-migrations/upgrade_184.sql
new file mode 100644
index 0000000..8081654
--- /dev/null
+++ b/schema/mysql-migrations/upgrade_184.sql
@@ -0,0 +1,9 @@
+ALTER TABLE branched_icinga_notification
+ ADD COLUMN users_var VARCHAR(255) DEFAULT NULL AFTER zone;
+
+ALTER TABLE branched_icinga_notification
+ ADD COLUMN user_groups_var VARCHAR(255) DEFAULT NULL AFTER users_var;
+
+INSERT INTO director_schema_migration
+ (schema_version, migration_time)
+ VALUES (184, NOW());
diff --git a/schema/mysql-migrations/upgrade_186.sql b/schema/mysql-migrations/upgrade_186.sql
new file mode 100644
index 0000000..f0c8bda
--- /dev/null
+++ b/schema/mysql-migrations/upgrade_186.sql
@@ -0,0 +1,35 @@
+ALTER TABLE director_datafield ADD COLUMN uuid VARBINARY(16) DEFAULT NULL AFTER id;
+SET @tmp_uuid = LOWER(CONCAT(
+ LPAD(HEX(FLOOR(RAND() * 0xffff)), 4, '0'),
+ LPAD(HEX(FLOOR(RAND() * 0xffff)), 4, '0'), '-',
+ LPAD(HEX(FLOOR(RAND() * 0xffff)), 4, '0'), '-',
+ '4',
+ LPAD(HEX(FLOOR(RAND() * 0x0fff)), 3, '0'), '-',
+ HEX(FLOOR(RAND() * 4 + 8)),
+ LPAD(HEX(FLOOR(RAND() * 0x0fff)), 3, '0'), '-',
+ LPAD(HEX(FLOOR(RAND() * 0xffff)), 4, '0'),
+ LPAD(HEX(FLOOR(RAND() * 0xffff)), 4, '0'),
+ LPAD(HEX(FLOOR(RAND() * 0xffff)), 4, '0')
+));
+UPDATE director_datafield SET uuid = UNHEX(LPAD(LPAD(HEX(id), 8, '0'), 32, REPLACE(@tmp_uuid, '-', ''))) WHERE uuid IS NULL;
+ALTER TABLE director_datafield MODIFY COLUMN uuid VARBINARY(16) NOT NULL, ADD UNIQUE INDEX uuid (uuid);
+
+ALTER TABLE director_datalist ADD COLUMN uuid VARBINARY(16) DEFAULT NULL AFTER id;
+SET @tmp_uuid = LOWER(CONCAT(
+ LPAD(HEX(FLOOR(RAND() * 0xffff)), 4, '0'),
+ LPAD(HEX(FLOOR(RAND() * 0xffff)), 4, '0'), '-',
+ LPAD(HEX(FLOOR(RAND() * 0xffff)), 4, '0'), '-',
+ '4',
+ LPAD(HEX(FLOOR(RAND() * 0x0fff)), 3, '0'), '-',
+ HEX(FLOOR(RAND() * 4 + 8)),
+ LPAD(HEX(FLOOR(RAND() * 0x0fff)), 3, '0'), '-',
+ LPAD(HEX(FLOOR(RAND() * 0xffff)), 4, '0'),
+ LPAD(HEX(FLOOR(RAND() * 0xffff)), 4, '0'),
+ LPAD(HEX(FLOOR(RAND() * 0xffff)), 4, '0')
+));
+UPDATE director_datalist SET uuid = UNHEX(LPAD(LPAD(HEX(id), 8, '0'), 32, REPLACE(@tmp_uuid, '-', ''))) WHERE uuid IS NULL;
+ALTER TABLE director_datalist MODIFY COLUMN uuid VARBINARY(16) NOT NULL, ADD UNIQUE INDEX uuid (uuid);
+
+INSERT INTO director_schema_migration
+ (schema_version, migration_time)
+ VALUES (186, NOW());
diff --git a/schema/mysql-migrations/upgrade_187.sql b/schema/mysql-migrations/upgrade_187.sql
new file mode 100644
index 0000000..0e96f14
--- /dev/null
+++ b/schema/mysql-migrations/upgrade_187.sql
@@ -0,0 +1,5 @@
+ALTER TABLE import_row_modifier ADD COLUMN filter_expression TEXT DEFAULT NULL AFTER priority;
+
+INSERT INTO director_schema_migration
+ (schema_version, migration_time)
+ VALUES (187, NOW());
diff --git a/schema/mysql.sql b/schema/mysql.sql
index 02ac5d9..832ab12 100644
--- a/schema/mysql.sql
+++ b/schema/mysql.sql
@@ -177,6 +177,7 @@ CREATE TABLE director_deployment_log (
CREATE TABLE director_datalist (
id INT(10) UNSIGNED AUTO_INCREMENT NOT NULL,
+ uuid VARBINARY(16) NOT NULL,
list_name VARCHAR(255) NOT NULL,
owner VARCHAR(255) NOT NULL,
PRIMARY KEY (id),
@@ -207,6 +208,7 @@ CREATE TABLE director_datafield_category (
CREATE TABLE director_datafield (
id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ uuid VARBINARY(16) NOT NULL,
category_id INT(10) UNSIGNED DEFAULT NULL,
varname VARCHAR(64) NOT NULL COLLATE utf8_bin,
caption VARCHAR(255) NOT NULL,
@@ -1260,6 +1262,8 @@ CREATE TABLE icinga_notification (
command_id INT(10) UNSIGNED DEFAULT NULL,
period_id INT(10) UNSIGNED DEFAULT NULL,
zone_id INT(10) UNSIGNED DEFAULT NULL,
+ users_var VARCHAR(255) DEFAULT NULL,
+ user_groups_var VARCHAR(255) DEFAULT NULL,
assign_filter TEXT DEFAULT NULL,
PRIMARY KEY (id),
UNIQUE INDEX uuid (uuid),
@@ -1455,6 +1459,7 @@ CREATE TABLE import_row_modifier (
target_property VARCHAR(255) DEFAULT NULL,
provider_class VARCHAR(128) NOT NULL,
priority SMALLINT UNSIGNED NOT NULL,
+ filter_expression TEXT DEFAULT NULL,
description TEXT DEFAULT NULL,
PRIMARY KEY (id),
KEY search_idx (property_name),
@@ -2351,6 +2356,8 @@ CREATE TABLE branched_icinga_notification (
command VARCHAR(255) DEFAULT NULL,
period VARCHAR(255) DEFAULT NULL,
zone VARCHAR(255) DEFAULT NULL,
+ users_var VARCHAR(255) DEFAULT NULL,
+ user_groups_var VARCHAR(255) DEFAULT NULL,
assign_filter TEXT DEFAULT NULL,
states TEXT DEFAULT NULL,
@@ -2439,4 +2446,4 @@ CREATE TABLE branched_icinga_dependency (
INSERT INTO director_schema_migration
(schema_version, migration_time)
- VALUES (182, NOW());
+ VALUES (187, NOW());
diff --git a/schema/pgsql-migrations/upgrade_183.sql b/schema/pgsql-migrations/upgrade_183.sql
new file mode 100644
index 0000000..b9964ef
--- /dev/null
+++ b/schema/pgsql-migrations/upgrade_183.sql
@@ -0,0 +1,9 @@
+ALTER TABLE icinga_notification
+ ADD COLUMN users_var character varying(255) DEFAULT NULL;
+
+ALTER TABLE icinga_notification
+ ADD COLUMN user_groups_var character varying(255) DEFAULT NULL;
+
+INSERT INTO director_schema_migration
+ (schema_version, migration_time)
+ VALUES (183, NOW());
diff --git a/schema/pgsql-migrations/upgrade_184.sql b/schema/pgsql-migrations/upgrade_184.sql
new file mode 100644
index 0000000..834e6a9
--- /dev/null
+++ b/schema/pgsql-migrations/upgrade_184.sql
@@ -0,0 +1,9 @@
+ALTER TABLE branched_icinga_notification
+ ADD COLUMN users_var character varying(255) DEFAULT NULL;
+
+ALTER TABLE branched_icinga_notification
+ ADD COLUMN user_groups_var character varying(255) DEFAULT NULL;
+
+INSERT INTO director_schema_migration
+ (schema_version, migration_time)
+ VALUES (184, NOW());
diff --git a/schema/pgsql-migrations/upgrade_186.sql b/schema/pgsql-migrations/upgrade_186.sql
new file mode 100644
index 0000000..cb491f6
--- /dev/null
+++ b/schema/pgsql-migrations/upgrade_186.sql
@@ -0,0 +1,11 @@
+ALTER TABLE director_datafield ADD COLUMN uuid bytea UNIQUE CHECK(LENGTH(uuid) = 16);
+UPDATE director_datafield SET uuid = decode(replace(gen_random_uuid()::text, '-', ''), 'hex') WHERE uuid IS NULL;
+ALTER TABLE director_datafield ALTER COLUMN uuid SET NOT NULL;
+
+ALTER TABLE director_datalist ADD COLUMN uuid bytea UNIQUE CHECK(LENGTH(uuid) = 16);
+UPDATE director_datalist SET uuid = decode(replace(gen_random_uuid()::text, '-', ''), 'hex') WHERE uuid IS NULL;
+ALTER TABLE director_datalist ALTER COLUMN uuid SET NOT NULL;
+
+INSERT INTO director_schema_migration
+(schema_version, migration_time)
+VALUES (186, NOW());
diff --git a/schema/pgsql-migrations/upgrade_187.sql b/schema/pgsql-migrations/upgrade_187.sql
new file mode 100644
index 0000000..08b422a
--- /dev/null
+++ b/schema/pgsql-migrations/upgrade_187.sql
@@ -0,0 +1,5 @@
+ALTER TABLE import_row_modifier ADD COLUMN filter_expression text DEFAULT NULL;
+
+INSERT INTO director_schema_migration
+ (schema_version, migration_time)
+ VALUES (187, NOW());
diff --git a/schema/pgsql.sql b/schema/pgsql.sql
index b9b2cf8..32931e6 100644
--- a/schema/pgsql.sql
+++ b/schema/pgsql.sql
@@ -246,6 +246,7 @@ CREATE INDEX start_time_idx ON director_deployment_log (start_time);
CREATE TABLE director_datalist (
id serial,
+ uuid bytea CHECK(LENGTH(uuid) = 16) NOT NULL,
list_name character varying(255) NOT NULL,
owner character varying(255) NOT NULL,
PRIMARY KEY (id)
@@ -283,6 +284,7 @@ CREATE UNIQUE INDEX datafield_category_name ON director_datafield_category (cate
CREATE TABLE director_datafield (
id serial,
+ uuid bytea CHECK(LENGTH(uuid) = 16) NOT NULL,
category_id integer DEFAULT NULL,
varname character varying(64) NOT NULL,
caption character varying(255) NOT NULL,
@@ -1503,6 +1505,8 @@ CREATE TABLE icinga_notification (
command_id integer DEFAULT NULL,
period_id integer DEFAULT NULL,
zone_id integer DEFAULT NULL,
+ users_var character varying(255) DEFAULT NULL,
+ user_groups_var character varying(255) DEFAULT NULL,
assign_filter text DEFAULT NULL,
PRIMARY KEY (id),
CONSTRAINT icinga_notification_host
@@ -1604,6 +1608,7 @@ CREATE TABLE import_row_modifier (
target_property character varying(255) DEFAULT NULL,
provider_class character varying(128) NOT NULL,
priority integer NOT NULL,
+ filter_expression text DEFAULT NULL,
description text DEFAULT NULL,
PRIMARY KEY (id),
CONSTRAINT row_modifier_import_source
@@ -2684,6 +2689,8 @@ CREATE TABLE branched_icinga_notification (
command character varying(255) DEFAULT NULL,
period character varying(255) DEFAULT NULL,
zone character varying(255) DEFAULT NULL,
+ users_var character varying(255) DEFAULT NULL,
+ user_groups_var character varying(255) DEFAULT NULL,
assign_filter text DEFAULT NULL,
states TEXT DEFAULT NULL,
@@ -2778,4 +2785,4 @@ CREATE INDEX branched_dependency_search_object_name ON branched_icinga_dependenc
INSERT INTO director_schema_migration
(schema_version, migration_time)
- VALUES (182, NOW());
+ VALUES (187, NOW());