From 61cb105ab1f1558eba85b2c62dd446c1be2f54f2 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 14 Nov 2018 08:21:57 +0100 Subject: [PATCH] schema: allow for larger basket summaries fixes #1701 --- schema/mysql-migrations/upgrade_157.sql | 6 ++++++ schema/mysql.sql | 4 ++-- schema/pgsql-migrations/upgrade_157.sql | 6 ++++++ schema/pgsql.sql | 4 ++-- 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 schema/mysql-migrations/upgrade_157.sql create mode 100644 schema/pgsql-migrations/upgrade_157.sql diff --git a/schema/mysql-migrations/upgrade_157.sql b/schema/mysql-migrations/upgrade_157.sql new file mode 100644 index 00000000..f093a884 --- /dev/null +++ b/schema/mysql-migrations/upgrade_157.sql @@ -0,0 +1,6 @@ +ALTER TABLE director_basket_content + MODIFY COLUMN summary VARCHAR(500) NOT NULL; + + INSERT INTO director_schema_migration + (schema_version, migration_time) + VALUES (157, NOW()); diff --git a/schema/mysql.sql b/schema/mysql.sql index ae169bbd..d0b086cd 100644 --- a/schema/mysql.sql +++ b/schema/mysql.sql @@ -44,7 +44,7 @@ CREATE TABLE director_basket ( CREATE TABLE director_basket_content ( checksum VARBINARY(20) NOT NULL, - summary VARCHAR(255) NOT NULL, -- json + summary VARCHAR(500) NOT NULL, -- json content MEDIUMTEXT NOT NULL, -- json PRIMARY KEY (checksum) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin; @@ -1787,4 +1787,4 @@ CREATE TABLE icinga_timeperiod_exclude ( INSERT INTO director_schema_migration (schema_version, migration_time) - VALUES (156, NOW()); + VALUES (157, NOW()); diff --git a/schema/pgsql-migrations/upgrade_157.sql b/schema/pgsql-migrations/upgrade_157.sql new file mode 100644 index 00000000..02ce3700 --- /dev/null +++ b/schema/pgsql-migrations/upgrade_157.sql @@ -0,0 +1,6 @@ +ALTER TABLE director_basket_content + ALTER COLUMN summary TYPE VARCHAR(500); + +INSERT INTO director_schema_migration + (schema_version, migration_time) + VALUES (157, NOW()); diff --git a/schema/pgsql.sql b/schema/pgsql.sql index b7f701f2..9d7035b0 100644 --- a/schema/pgsql.sql +++ b/schema/pgsql.sql @@ -86,7 +86,7 @@ CREATE UNIQUE INDEX basket_basket_name ON director_basket (basket_name); CREATE TABLE director_basket_content ( checksum bytea CHECK(LENGTH(checksum) = 20) NOT NULL, - summary VARCHAR(255) NOT NULL, -- json + summary VARCHAR(500) NOT NULL, -- json content text NOT NULL, -- json PRIMARY KEY (checksum) ); @@ -2087,4 +2087,4 @@ CREATE TABLE icinga_timeperiod_exclude ( INSERT INTO director_schema_migration (schema_version, migration_time) - VALUES (156, NOW()); + VALUES (157, NOW());