[icinga-checkins] icinga.org: icingaweb2-module-director/master: schema: add more sync object types

git at icinga.org git at icinga.org
Wed Oct 12 10:53:14 CEST 2016


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

Author: Thomas Gelf <thomas at gelf.net>
Date:   Wed Oct 12 08:50:58 2016 +0000

schema: add more sync object types

fixes #11361

---

 schema/mysql-migrations/upgrade_116.sql |   18 ++++++++++++++++++
 schema/mysql.sql                        |    6 ++++--
 schema/pgsql-migrations/upgrade_116.sql |    6 ++++++
 schema/pgsql.sql                        |   12 ++++--------
 4 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/schema/mysql-migrations/upgrade_116.sql b/schema/mysql-migrations/upgrade_116.sql
new file mode 100644
index 0000000..a252d42
--- /dev/null
+++ b/schema/mysql-migrations/upgrade_116.sql
@@ -0,0 +1,18 @@
+ALTER TABLE sync_rule MODIFY object_type enum(
+  'host',
+  'service',
+  'command',
+  'user',
+  'hostgroup',
+  'servicegroup',
+  'usergroup',
+  'datalistEntry',
+  'endpoint',
+  'zone',
+  'timePeriod',
+  'serviceSet'
+) NOT NULL;
+
+INSERT INTO director_schema_migration
+  (schema_version, migration_time)
+  VALUES (116, NOW());
diff --git a/schema/mysql.sql b/schema/mysql.sql
index 70365fd..e972358 100644
--- a/schema/mysql.sql
+++ b/schema/mysql.sql
@@ -1337,7 +1337,9 @@ CREATE TABLE sync_rule (
     'usergroup',
     'datalistEntry',
     'endpoint',
-    'zone'
+    'zone',
+    'timePeriod',
+    'serviceSet'
   ) NOT NULL,
   update_policy ENUM('merge', 'override', 'ignore') NOT NULL,
   purge_existing ENUM('y', 'n') NOT NULL DEFAULT 'n',
@@ -1396,4 +1398,4 @@ CREATE TABLE sync_run (
 
 INSERT INTO director_schema_migration
   SET migration_time = NOW(),
-      schema_version = 115;
+      schema_version = 116;
diff --git a/schema/pgsql-migrations/upgrade_116.sql b/schema/pgsql-migrations/upgrade_116.sql
new file mode 100644
index 0000000..3190739
--- /dev/null
+++ b/schema/pgsql-migrations/upgrade_116.sql
@@ -0,0 +1,6 @@
+ALTER TYPE enum_sync_rule_object_type ADD VALUE 'timePeriod';
+ALTER TYPE enum_sync_rule_object_type ADD VALUE 'serviceSet';
+
+INSERT INTO director_schema_migration
+  (schema_version, migration_time)
+  VALUES (116, NOW());
diff --git a/schema/pgsql.sql b/schema/pgsql.sql
index 9a82cbc..6e050c1 100644
--- a/schema/pgsql.sql
+++ b/schema/pgsql.sql
@@ -6,12 +6,6 @@
 -- Director does all the migrations for you and guides you either in
 -- the frontend or provides everything you need for automated migration
 -- handling. Please find more related information in our documentation.
---
--- Please note: PostgreSQL has not all migrations as MySQL have them
---
--- If you have used PostgreSQL prior the first release of director,
--- you might have to recreate the schema.
---
 
 CREATE TYPE enum_activity_action AS ENUM('create', 'delete', 'modify');
 CREATE TYPE enum_boolean AS ENUM('y', 'n');
@@ -36,7 +30,9 @@ CREATE TYPE enum_sync_rule_object_type AS ENUM(
   'usergroup',
   'datalistEntry',
   'endpoint',
-  'zone'
+  'zone',
+  'timePeriod',
+  'serviceSet'
 );
 CREATE TYPE enum_sync_rule_update_policy AS ENUM('merge', 'override', 'ignore');
 CREATE TYPE enum_sync_property_merge_policy AS ENUM('override', 'merge');
@@ -1627,4 +1623,4 @@ CREATE UNIQUE INDEX notification_inheritance ON icinga_notification_inheritance
 
 INSERT INTO director_schema_migration
   (schema_version, migration_time)
-  VALUES (115, NOW());
+  VALUES (116, NOW());



More information about the icinga-checkins mailing list