summaryrefslogtreecommitdiffstats
path: root/schema/mysql/upgrades
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:41:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:41:39 +0000
commitfcfb5e62f95d625836328131cc5ca851182bcae4 (patch)
tree5309ef2284a82d61ece838d1dd1c97c09df152b8 /schema/mysql/upgrades
parentAdding upstream version 1.1.1. (diff)
downloadicingadb-upstream/1.2.0.tar.xz
icingadb-upstream/1.2.0.zip
Adding upstream version 1.2.0.upstream/1.2.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--schema/mysql/upgrades/1.0.0-rc2.sql2
-rw-r--r--schema/mysql/upgrades/1.0.0.sql2
-rw-r--r--schema/mysql/upgrades/1.1.1.sql2
-rw-r--r--schema/mysql/upgrades/1.2.0.sql13
-rw-r--r--schema/mysql/upgrades/optional/1.2.0-history.sql1
5 files changed, 17 insertions, 3 deletions
diff --git a/schema/mysql/upgrades/1.0.0-rc2.sql b/schema/mysql/upgrades/1.0.0-rc2.sql
index 50fb2f9..d4695cd 100644
--- a/schema/mysql/upgrades/1.0.0-rc2.sql
+++ b/schema/mysql/upgrades/1.0.0-rc2.sql
@@ -156,7 +156,7 @@ ALTER TABLE acknowledgement_history
MODIFY is_persistent enum('n','y') DEFAULT NULL COMMENT 'NULL if ack_set event happened before Icinga DB history recording';
INSERT INTO icingadb_schema (version, timestamp)
- VALUES (2, CURRENT_TIMESTAMP() * 1000);
+ VALUES (2, UNIX_TIMESTAMP() * 1000);
ALTER TABLE host_state
MODIFY output longtext DEFAULT NULL,
diff --git a/schema/mysql/upgrades/1.0.0.sql b/schema/mysql/upgrades/1.0.0.sql
index 16bb45e..054e10e 100644
--- a/schema/mysql/upgrades/1.0.0.sql
+++ b/schema/mysql/upgrades/1.0.0.sql
@@ -288,4 +288,4 @@ INSERT INTO sla_history_downtime
ON DUPLICATE KEY UPDATE sla_history_downtime.downtime_id = sla_history_downtime.downtime_id;
INSERT INTO icingadb_schema (version, TIMESTAMP)
- VALUES (3, CURRENT_TIMESTAMP() * 1000);
+ VALUES (3, UNIX_TIMESTAMP() * 1000);
diff --git a/schema/mysql/upgrades/1.1.1.sql b/schema/mysql/upgrades/1.1.1.sql
index 264ecae..b0d5b69 100644
--- a/schema/mysql/upgrades/1.1.1.sql
+++ b/schema/mysql/upgrades/1.1.1.sql
@@ -34,4 +34,4 @@ ALTER TABLE history
UNLOCK TABLES;
INSERT INTO icingadb_schema (version, timestamp)
- VALUES (4, CURRENT_TIMESTAMP() * 1000);
+ VALUES (4, UNIX_TIMESTAMP() * 1000);
diff --git a/schema/mysql/upgrades/1.2.0.sql b/schema/mysql/upgrades/1.2.0.sql
new file mode 100644
index 0000000..74cbcb1
--- /dev/null
+++ b/schema/mysql/upgrades/1.2.0.sql
@@ -0,0 +1,13 @@
+UPDATE icingadb_schema SET timestamp = UNIX_TIMESTAMP(timestamp / 1000) * 1000 WHERE timestamp > 20000000000000000;
+
+ALTER TABLE history ADD INDEX idx_history_event_time_event_type (event_time, event_type) COMMENT 'History filtered/ordered by event_time/event_type';
+ALTER TABLE history DROP INDEX idx_history_event_time;
+
+ALTER TABLE host_state MODIFY COLUMN check_attempt int unsigned NOT NULL;
+
+ALTER TABLE service_state MODIFY COLUMN check_attempt int unsigned NOT NULL;
+
+ALTER TABLE state_history MODIFY COLUMN check_attempt tinyint unsigned NOT NULL COMMENT 'optional schema upgrade not applied yet, see https://icinga.com/docs/icinga-db/latest/doc/04-Upgrading/#upgrading-to-icinga-db-v112';
+
+INSERT INTO icingadb_schema (version, timestamp)
+ VALUES (5, UNIX_TIMESTAMP() * 1000);
diff --git a/schema/mysql/upgrades/optional/1.2.0-history.sql b/schema/mysql/upgrades/optional/1.2.0-history.sql
new file mode 100644
index 0000000..4081fcb
--- /dev/null
+++ b/schema/mysql/upgrades/optional/1.2.0-history.sql
@@ -0,0 +1 @@
+ALTER TABLE state_history MODIFY COLUMN check_attempt int unsigned NOT NULL;