[icinga-checkins] icinga.org: icingaweb2-module-director/fiddle/mfrosch-2: WIP: SQL: ensure last_error_message is stored as TEXT

git at icinga.org git at icinga.org
Fri Jul 22 12:03:50 CEST 2016


Module: icingaweb2-module-director
Branch: fiddle/mfrosch-2
Commit: 871e809657f99b8ea386431a25d8af61e725383c
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=871e809657f99b8ea386431a25d8af61e725383c

Author: Markus Frosch <lazyfrosch at icinga.org>
Date:   Fri Jul 22 12:03:36 2016 +0200

WIP: SQL: ensure last_error_message is stored as TEXT

---

 schema/mysql-migrations/upgrade_X3.sql |    5 +++++
 schema/mysql.sql                       |    2 +-
 schema/pgsql-migrations/upgrade_X3.sql |    9 +++++++++
 schema/pgsql.sql                       |    4 ++--
 4 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/schema/mysql-migrations/upgrade_X3.sql b/schema/mysql-migrations/upgrade_X3.sql
new file mode 100644
index 0000000..37a99d0
--- /dev/null
+++ b/schema/mysql-migrations/upgrade_X3.sql
@@ -0,0 +1,5 @@
+ALTER TABLE icingaweb2.sync_rule MODIFY last_error_message TEXT;
+
+-- INSERT INTO director_schema_migration
+--   (schema_version, migration_time)
+--   VALUES (X3, NOW());
diff --git a/schema/mysql.sql b/schema/mysql.sql
index 5c32957..378f756 100644
--- a/schema/mysql.sql
+++ b/schema/mysql.sql
@@ -1274,7 +1274,7 @@ CREATE TABLE sync_rule (
     'pending-changes',
     'failing'
   ) NOT NULL DEFAULT 'unknown',
-  last_error_message VARCHAR(255) DEFAULT NULL,
+  last_error_message TEXT DEFAULT NULL,
   last_attempt DATETIME DEFAULT NULL,
   PRIMARY KEY (id)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
diff --git a/schema/pgsql-migrations/upgrade_X3.sql b/schema/pgsql-migrations/upgrade_X3.sql
new file mode 100644
index 0000000..6326b24
--- /dev/null
+++ b/schema/pgsql-migrations/upgrade_X3.sql
@@ -0,0 +1,9 @@
+ALTER TABLE import_source
+    ALTER COLUMN last_error_message TYPE TEXT;
+
+ALTER TABLE sync_rule
+  ALTER COLUMN last_error_message TYPE TEXT;
+
+-- INSERT INTO director_schema_migration
+--   (schema_version, migration_time)
+--   VALUES (X3, NOW());
diff --git a/schema/pgsql.sql b/schema/pgsql.sql
index 2ad7af3..e3646c7 100644
--- a/schema/pgsql.sql
+++ b/schema/pgsql.sql
@@ -1270,7 +1270,7 @@ CREATE TABLE import_source (
   key_column character varying(64) NOT NULL,
   provider_class character varying(72) NOT NULL,
   import_state enum_sync_state NOT NULL DEFAULT 'unknown',
-  last_error_message character varying(255) NULL DEFAULT NULL,
+  last_error_message text NULL DEFAULT NULL,
   last_attempt timestamp with time zone NULL DEFAULT NULL,
   PRIMARY KEY (id)
 );
@@ -1421,7 +1421,7 @@ CREATE TABLE sync_rule (
   purge_existing enum_boolean NOT NULL DEFAULT 'n',
   filter_expression text DEFAULT NULL,
   sync_state enum_sync_state NOT NULL DEFAULT 'unknown',
-  last_error_message character varying(255) NULL DEFAULT NULL,
+  last_error_message text NULL DEFAULT NULL,
   last_attempt timestamp with time zone NULL DEFAULT NULL,
   PRIMARY KEY (id)
 );



More information about the icinga-checkins mailing list