schema: allow for larger basket summaries

fixes #1701
This commit is contained in:
Thomas Gelf 2018-11-14 08:21:57 +01:00
parent 06f5db698f
commit 61cb105ab1
4 changed files with 16 additions and 4 deletions

View File

@ -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());

View File

@ -44,7 +44,7 @@ CREATE TABLE director_basket (
CREATE TABLE director_basket_content ( CREATE TABLE director_basket_content (
checksum VARBINARY(20) NOT NULL, checksum VARBINARY(20) NOT NULL,
summary VARCHAR(255) NOT NULL, -- json summary VARCHAR(500) NOT NULL, -- json
content MEDIUMTEXT NOT NULL, -- json content MEDIUMTEXT NOT NULL, -- json
PRIMARY KEY (checksum) PRIMARY KEY (checksum)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin;
@ -1787,4 +1787,4 @@ CREATE TABLE icinga_timeperiod_exclude (
INSERT INTO director_schema_migration INSERT INTO director_schema_migration
(schema_version, migration_time) (schema_version, migration_time)
VALUES (156, NOW()); VALUES (157, NOW());

View File

@ -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());

View File

@ -86,7 +86,7 @@ CREATE UNIQUE INDEX basket_basket_name ON director_basket (basket_name);
CREATE TABLE director_basket_content ( CREATE TABLE director_basket_content (
checksum bytea CHECK(LENGTH(checksum) = 20) NOT NULL, 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 content text NOT NULL, -- json
PRIMARY KEY (checksum) PRIMARY KEY (checksum)
); );
@ -2087,4 +2087,4 @@ CREATE TABLE icinga_timeperiod_exclude (
INSERT INTO director_schema_migration INSERT INTO director_schema_migration
(schema_version, migration_time) (schema_version, migration_time)
VALUES (156, NOW()); VALUES (157, NOW());