icingadb/schema/pgsql/upgrades/1.5.2-pr1063.sql
Alvar Penning 167076cc4b
Align Icinga 2 Types with SQL Representation
Certain Icinga 2 object fields of a floating type are incorrectly stored
as unsigned integers in the schema. Since none of those columns are in
the history tables, changing them was considered not too invasive.

Furthermore, some struct fields were changed from "float64" to
"types.Float", since the SQL schema supports NULL values.

Fixes #882.
2026-01-13 16:53:38 +01:00

27 lines
953 B
SQL

ALTER TABLE host
ALTER COLUMN check_timeout TYPE float,
ALTER COLUMN check_timeout SET DEFAULT NULL,
ALTER COLUMN check_interval TYPE float,
ALTER COLUMN check_retry_interval TYPE float;
ALTER TABLE host_state
ALTER COLUMN execution_time TYPE float,
ALTER COLUMN execution_time SET DEFAULT NULL,
ALTER COLUMN latency TYPE float,
ALTER COLUMN latency SET DEFAULT NULL,
ALTER COLUMN check_timeout TYPE float,
ALTER COLUMN check_timeout SET DEFAULT NULL;
ALTER TABLE service
ALTER COLUMN check_timeout TYPE float,
ALTER COLUMN check_timeout SET DEFAULT NULL,
ALTER COLUMN check_interval TYPE float,
ALTER COLUMN check_retry_interval TYPE float;
ALTER TABLE service_state
ALTER COLUMN execution_time TYPE float,
ALTER COLUMN execution_time SET DEFAULT NULL,
ALTER COLUMN latency TYPE float,
ALTER COLUMN latency SET DEFAULT NULL,
ALTER COLUMN check_timeout TYPE float,
ALTER COLUMN check_timeout SET DEFAULT NULL;