[icinga-checkins] icinga.org: icingaweb2-module-director/master: schema/mysql: re-create import modifier tables

git at icinga.org git at icinga.org
Thu Feb 18 00:52:39 CET 2016


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

Author: Thomas Gelf <thomas at gelf.net>
Date:   Wed Feb 17 22:12:00 2016 +0100

schema/mysql: re-create import modifier tables

---

 schema/mysql-migrations/upgrade_66.sql |   37 +++++++++++++++++++++++++++
 schema/mysql.sql                       |   43 +++++++++++++++++++++-----------
 2 files changed, 65 insertions(+), 15 deletions(-)

diff --git a/schema/mysql-migrations/upgrade_66.sql b/schema/mysql-migrations/upgrade_66.sql
new file mode 100644
index 0000000..9ce2cd8
--- /dev/null
+++ b/schema/mysql-migrations/upgrade_66.sql
@@ -0,0 +1,37 @@
+
+-- dropping old tables, as they have never been used
+
+DROP TABLE import_row_modifier_setting;
+DROP TABLE import_row_modifier;
+
+CREATE TABLE import_row_modifier (
+  id INT(10) UNSIGNED AUTO_INCREMENT NOT NULL,
+  source_id INT(10) UNSIGNED NOT NULL,
+  property_name VARCHAR(255) NOT NULL,
+  provider_class VARCHAR(72) NOT NULL,
+  priority SMALLINT UNSIGNED NOT NULL,
+  PRIMARY KEY (id),
+  KEY search_idx (property_name),
+  CONSTRAINT row_modifier_import_source
+    FOREIGN KEY source (source_id)
+    REFERENCES import_source (id)
+    ON DELETE CASCADE
+    ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE import_row_modifier_setting (
+  row_modifier_id INT UNSIGNED NOT NULL,
+  setting_name VARCHAR(64) NOT NULL,
+  setting_value TEXT DEFAULT NULL,
+  PRIMARY KEY (row_modifier_id, setting_name),
+  CONSTRAINT row_modifier_settings
+    FOREIGN KEY row_modifier (row_modifier_id)
+    REFERENCES import_row_modifier (id)
+    ON DELETE CASCADE
+    ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+INSERT INTO director_schema_migration
+  SET migration_time = NOW(),
+      schema_version = 66;
+
diff --git a/schema/mysql.sql b/schema/mysql.sql
index 7c093ca..922118c 100644
--- a/schema/mysql.sql
+++ b/schema/mysql.sql
@@ -924,6 +924,33 @@ CREATE TABLE import_source_setting (
     ON UPDATE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
+CREATE TABLE import_row_modifier (
+  id INT(10) UNSIGNED AUTO_INCREMENT NOT NULL,
+  source_id INT(10) UNSIGNED NOT NULL,
+  property_name VARCHAR(255) NOT NULL,
+  provider_class VARCHAR(72) NOT NULL,
+  priority SMALLINT UNSIGNED NOT NULL,
+  PRIMARY KEY (id),
+  KEY search_idx (property_name),
+  CONSTRAINT row_modifier_import_source
+    FOREIGN KEY source (source_id)
+    REFERENCES import_source (id)
+    ON DELETE CASCADE
+    ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE import_row_modifier_setting (
+  row_modifier_id INT UNSIGNED NOT NULL,
+  setting_name VARCHAR(64) NOT NULL,
+  setting_value TEXT DEFAULT NULL,
+  PRIMARY KEY (row_modifier_id, setting_name),
+  CONSTRAINT row_modifier_settings
+    FOREIGN KEY row_modifier (row_modifier_id)
+    REFERENCES import_row_modifier (id)
+    ON DELETE CASCADE
+    ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
 CREATE TABLE imported_rowset (
   checksum VARBINARY(20) NOT NULL,
   PRIMARY KEY (checksum)
@@ -1028,21 +1055,7 @@ CREATE TABLE sync_property (
     ON UPDATE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
-CREATE TABLE import_row_modifier (
-  id INT(10) UNSIGNED AUTO_INCREMENT NOT NULL,
-  property_id INT(10) UNSIGNED NOT NULL,
-  provider_class VARCHAR(72) NOT NULL,
-  PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-CREATE TABLE import_row_modifier_setting (
-  modifier_id INT UNSIGNED NOT NULL,
-  setting_name VARCHAR(64) NOT NULL,
-  setting_value TEXT DEFAULT NULL,
-  PRIMARY KEY (modifier_id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
 INSERT INTO director_schema_migration
   SET migration_time = NOW(),
-      schema_version = 65;
+      schema_version = 66;
 



More information about the icinga-checkins mailing list