Commit graph

12 commits

Author SHA1 Message Date
Alvar Penning
27d27d4539
schema: Fix values to fit by increasing type sizes
The icon_image_alt column in both the host and service tables contains
an image alt text. However, because it is defined as a varchar(32), many
alt texts do not fit. The type has been expanded to text, as with most
free text fields.

Closes #752.

When defining a TimePeriod, the maximum length of a range value was
capped at 255 characters. This limitation has now also been removed by
switching to the Text type.

Closes #724.

While re-reading the schema, I stumbled upon some missing
properties_checksum comments that were also added.
2024-07-30 10:38:19 +02:00
Alvar Penning
f0b7aa2d38
Bump version to 1.2.0 2024-04-11 13:23:34 +02:00
Alexander A. Klimov
2681634105 Unify check attempt data type to uint32 already used somewhere
A float isn't necessary as in Icinga 2 Checkable#max_check_attempts and
check_attempt are ints. But uint8 isn't enough for e.g. 1 check/s to get
HARD after 5m (300s > 255).
2024-04-08 16:01:53 +02:00
Yonas Habteab
2a0da3dec1 Add a correct composite INDEX for the history table 2024-04-05 15:43:20 +02:00
Alvar Penning
34ac3867a9 PostgreSQL: get_sla_ok_percent to return decimal
The final division within the get_sla_ok_percent SQL function in its
PostgreSQL implementation silently truncated decimal places. An explicit
decimal cast resulted for this equation resulted in a decimal value.

To both verify and catch this in the future, a test with odd numbers was
added. This already succeeded for MySQL, but needed the modified schema
for PostgreSQL.

Closes #648.
2024-03-20 13:16:24 +01:00
Julian Brost
653f356123 Increase database schema version
The removal of the `NOT NULL` constraint on `customvar_flat`.`flat_value` makes
the schema upgrade a hard requirement for 1.1.1.
2023-08-07 13:09:01 +02:00
Julian Brost
7a2ab2dff1 Schema: merge 1.2.0.sql upgrades into 1.1.1.sql
Initially, we planed a 1.2.0 release instead of 1.1.1 so over time, both schema
upgrade files appeared. Merge them to clean up in preparation for the 1.1.1
release.

Changes were generated using these commands:

    { echo; cat schema/mysql/upgrades/1.2.0.sql } >> schema/mysql/upgrades/1.1.1.sql
    { echo; cat schema/pgsql/upgrades/1.2.0.sql } >> schema/pgsql/upgrades/1.1.1.sql
    git rm schema/mysql/upgrades/1.2.0.sql
    git rm schema/pgsql/upgrades/1.2.0.sql
2023-08-07 13:09:01 +02:00
Julian Brost
6068ab78d0 Schema: change sort order of history event type enum
This improves the resulting sort order when `ORDER BY event_time, event_type`
is used. `state_change` comes first as it can cause many of the other events
like trigger downtimes, remove acknowledgements and send notifications.
Similarly, `notification` comes last as any other event can result in a
notification. This will result in history events for scenarios like state
changes, triggers downtime, sends downtime start notification being sorted in
that order.

Apart from that, end events sort before the corresponding start events as any
ack/comment/downtime/flapping period should last for more than a millisecond,
therefore if there should be two events within the same millisecond, the end
event corresponds to the older period and is sorted first.
2023-08-04 15:56:53 +02:00
Julian Brost
de09001a0f schema/pgsql: Add missing indices to hostgroup and servicegroup 2023-08-01 16:50:59 +02:00
Julian Brost
d4b3dec82a schema/pgsql: Add new index for customvar_flat 2023-08-01 15:57:25 +02:00
Yonas Habteab
fa0a712bac Flatten empty custom vars of type array & map correctly 2023-06-29 13:43:33 +02:00
Alexander A. Klimov
cde27fd608 schema: notification: enlarge name and name_ci 255 -> 767 2023-05-23 15:36:17 +02:00