Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL/MariaDB: Fix icingadb_schema.timestamp not being UNX time #700

Merged
merged 2 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion schema/mysql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1343,4 +1343,4 @@ CREATE TABLE icingadb_schema (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

INSERT INTO icingadb_schema (version, timestamp)
VALUES (4, CURRENT_TIMESTAMP() * 1000);
VALUES (4, UNIX_TIMESTAMP() * 1000);
2 changes: 1 addition & 1 deletion schema/mysql/upgrades/1.0.0-rc2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion schema/mysql/upgrades/1.0.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 1 addition & 1 deletion schema/mysql/upgrades/1.1.1.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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);
1 change: 1 addition & 0 deletions schema/mysql/upgrades/1.1.2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UPDATE icingadb_schema SET timestamp = UNIX_TIMESTAMP(timestamp / 1000) * 1000 WHERE timestamp > 20000000000000000;
Loading