[icinga-checkins] icinga.org: icingaweb2-module-director/master: schema: provide migration for conditional fields

git at icinga.org git at icinga.org
Wed Dec 14 17:45:13 CET 2016


Module: icingaweb2-module-director
Branch: master
Commit: 4f8f79557b4b2e0876e0580bfca349e5b850fe4e
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=4f8f79557b4b2e0876e0580bfca349e5b850fe4e

Author: Thomas Gelf <thomas at gelf.net>
Date:   Wed Dec 14 17:41:15 2016 +0100

schema: provide migration for conditional fields

fixes #13253

---

 schema/mysql-migrations/{upgrade_124xx.sql => upgrade_125.sql} |    2 +-
 schema/mysql.sql                                               |    7 ++++++-
 schema/pgsql-migrations/{upgrade_124xx.sql => upgrade_125.sql} |    2 +-
 schema/pgsql.sql                                               |    7 ++++++-
 4 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/schema/mysql-migrations/upgrade_124xx.sql b/schema/mysql-migrations/upgrade_125.sql
similarity index 95%
rename from schema/mysql-migrations/upgrade_124xx.sql
rename to schema/mysql-migrations/upgrade_125.sql
index 70aba05..b1ffea1 100644
--- a/schema/mysql-migrations/upgrade_124xx.sql
+++ b/schema/mysql-migrations/upgrade_125.sql
@@ -15,4 +15,4 @@ ALTER TABLE icinga_user_field
 
 INSERT INTO director_schema_migration
   (schema_version, migration_time)
-  VALUES (124, NOW());
+  VALUES (125, NOW());
diff --git a/schema/mysql.sql b/schema/mysql.sql
index 4dd1c8e..adb6537 100644
--- a/schema/mysql.sql
+++ b/schema/mysql.sql
@@ -337,6 +337,7 @@ CREATE TABLE icinga_command_field (
   command_id INT(10) UNSIGNED NOT NULL,
   datafield_id INT(10) UNSIGNED NOT NULL,
   is_required ENUM('y', 'n') NOT NULL,
+  var_filter TEXT DEFAULT NULL,
   PRIMARY KEY (command_id, datafield_id),
   CONSTRAINT icinga_command_field_command
   FOREIGN KEY command_id (command_id)
@@ -502,6 +503,7 @@ CREATE TABLE icinga_host_field (
   host_id INT(10) UNSIGNED NOT NULL COMMENT 'Makes only sense for templates',
   datafield_id INT(10) UNSIGNED NOT NULL,
   is_required ENUM('y', 'n') NOT NULL,
+  var_filter TEXT DEFAULT NULL,
   PRIMARY KEY (host_id, datafield_id),
   CONSTRAINT icinga_host_field_host
   FOREIGN KEY host(host_id)
@@ -653,6 +655,7 @@ CREATE TABLE icinga_service_field (
   service_id INT(10) UNSIGNED NOT NULL COMMENT 'Makes only sense for templates',
   datafield_id INT(10) UNSIGNED NOT NULL,
   is_required ENUM('y', 'n') NOT NULL,
+  var_filter TEXT DEFAULT NULL,
   PRIMARY KEY (service_id, datafield_id),
   CONSTRAINT icinga_service_field_service
   FOREIGN KEY service(service_id)
@@ -921,6 +924,7 @@ CREATE TABLE icinga_user_field (
   user_id INT(10) UNSIGNED NOT NULL COMMENT 'Makes only sense for templates',
   datafield_id INT(10) UNSIGNED NOT NULL,
   is_required ENUM('y', 'n') NOT NULL,
+  var_filter TEXT DEFAULT NULL,
   PRIMARY KEY (user_id, datafield_id),
   CONSTRAINT icinga_user_field_user
   FOREIGN KEY user(user_id)
@@ -1056,6 +1060,7 @@ CREATE TABLE icinga_notification_field (
   notification_id INT(10) UNSIGNED NOT NULL COMMENT 'Makes only sense for templates',
   datafield_id INT(10) UNSIGNED NOT NULL,
   is_required ENUM('y', 'n') NOT NULL,
+  var_filter TEXT DEFAULT NULL,
   PRIMARY KEY (notification_id, datafield_id),
   CONSTRAINT icinga_notification_field_notification
   FOREIGN KEY notification (notification_id)
@@ -1365,4 +1370,4 @@ CREATE TABLE sync_run (
 
 INSERT INTO director_schema_migration
   (schema_version, migration_time)
-  VALUES (124, NOW());
+  VALUES (125, NOW());
diff --git a/schema/pgsql-migrations/upgrade_124xx.sql b/schema/pgsql-migrations/upgrade_125.sql
similarity index 95%
rename from schema/pgsql-migrations/upgrade_124xx.sql
rename to schema/pgsql-migrations/upgrade_125.sql
index 31ab285..b1ffea1 100644
--- a/schema/pgsql-migrations/upgrade_124xx.sql
+++ b/schema/pgsql-migrations/upgrade_125.sql
@@ -15,4 +15,4 @@ ALTER TABLE icinga_user_field
 
 INSERT INTO director_schema_migration
   (schema_version, migration_time)
-  VALUES (123, NOW());
+  VALUES (125, NOW());
diff --git a/schema/pgsql.sql b/schema/pgsql.sql
index ccb801e..7fb5935 100644
--- a/schema/pgsql.sql
+++ b/schema/pgsql.sql
@@ -443,6 +443,7 @@ CREATE TABLE icinga_command_field (
   command_id integer NOT NULL,
   datafield_id integer NOT NULL,
   is_required enum_boolean NOT NULL,
+  var_filter TEXT DEFAULT NULL,
   PRIMARY KEY (command_id, datafield_id),
   CONSTRAINT icinga_command_field_command
     FOREIGN KEY (command_id)
@@ -635,6 +636,7 @@ CREATE TABLE icinga_host_field (
   host_id integer NOT NULL,
   datafield_id integer NOT NULL,
   is_required enum_boolean NOT NULL,
+  var_filter TEXT DEFAULT NULL,
   PRIMARY KEY (host_id, datafield_id),
   CONSTRAINT icinga_host_field_host
   FOREIGN KEY (host_id)
@@ -812,6 +814,7 @@ CREATE TABLE icinga_service_field (
   service_id integer NOT NULL,
   datafield_id integer NOT NULL,
   is_required enum_boolean NOT NULL,
+  var_filter TEXT DEFAULT NULL,
   PRIMARY KEY (service_id, datafield_id),
   CONSTRAINT icinga_service_field_service
   FOREIGN KEY (service_id)
@@ -1121,6 +1124,7 @@ CREATE TABLE icinga_user_field (
   user_id integer NOT NULL,
   datafield_id integer NOT NULL,
   is_required enum_boolean NOT NULL,
+  var_filter TEXT DEFAULT NULL,
   PRIMARY KEY (user_id, datafield_id),
   CONSTRAINT icinga_user_field_user
   FOREIGN KEY (user_id)
@@ -1552,6 +1556,7 @@ CREATE TABLE icinga_notification_field (
   notification_id integer NOT NULL,
   datafield_id integer NOT NULL,
   is_required enum_boolean NOT NULL,
+  var_filter TEXT DEFAULT NULL,
   PRIMARY KEY (notification_id, datafield_id),
   CONSTRAINT icinga_notification_field_notification
   FOREIGN KEY (notification_id)
@@ -1593,4 +1598,4 @@ CREATE UNIQUE INDEX notification_inheritance ON icinga_notification_inheritance
 
 INSERT INTO director_schema_migration
   (schema_version, migration_time)
-  VALUES (124, NOW());
+  VALUES (125, NOW());



More information about the icinga-checkins mailing list