From 3213d1824973cf8193e0eb69fea0b6394a1fe09a Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Fri, 28 Jan 2022 11:51:38 +0100 Subject: [PATCH] Schema: make notification_history#text longtext --- cmd/icingadb/main.go | 2 +- schema/mysql/schema.sql | 4 ++-- schema/mysql/upgrades/1.0.0.sql | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 schema/mysql/upgrades/1.0.0.sql diff --git a/cmd/icingadb/main.go b/cmd/icingadb/main.go index 1065989f..b23c952c 100644 --- a/cmd/icingadb/main.go +++ b/cmd/icingadb/main.go @@ -27,7 +27,7 @@ const ( ExitSuccess = 0 ExitFailure = 1 expectedRedisSchemaVersion = "4" - expectedDbSchemaVersion = 2 + expectedDbSchemaVersion = 3 ) func main() { diff --git a/schema/mysql/schema.sql b/schema/mysql/schema.sql index fbf0e900..defcf616 100644 --- a/schema/mysql/schema.sql +++ b/schema/mysql/schema.sql @@ -945,7 +945,7 @@ CREATE TABLE notification_history ( state tinyint unsigned NOT NULL, previous_hard_state tinyint unsigned NOT NULL, author text NOT NULL, - `text` text NOT NULL, + `text` longtext NOT NULL, users_notified smallint unsigned NOT NULL, PRIMARY KEY (id), @@ -1121,4 +1121,4 @@ CREATE TABLE icingadb_schema ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC; INSERT INTO icingadb_schema (version, timestamp) - VALUES (2, CURRENT_TIMESTAMP() * 1000); + VALUES (3, CURRENT_TIMESTAMP() * 1000); diff --git a/schema/mysql/upgrades/1.0.0.sql b/schema/mysql/upgrades/1.0.0.sql new file mode 100644 index 00000000..ffd4404e --- /dev/null +++ b/schema/mysql/upgrades/1.0.0.sql @@ -0,0 +1,5 @@ +ALTER TABLE notification_history + MODIFY `text` longtext NOT NULL; + +INSERT INTO icingadb_schema (version, timestamp) + VALUES (3, CURRENT_TIMESTAMP() * 1000);