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.
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).
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.
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
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.
When UPSERT and DELETE statements are executed at the same time, a
deadlock can occur if both want to get an exclusive lock on one of the
PRIMARY KEY index pages. This happens with DELETE statements when there
is no suitable index for the columns used in the WHERE clause, which is
true for our history retention queries since commit eccac78. This PR
fixes the problem by adding a suitable index for the columns used in
these queries.
At the moment Icinga DB Web doesn't know the column types, so it sends
SQL queries with LIKE operators for all suggestions in the search bar,
which fails for numeric and enum types on PostgreSQL. To support this,
the LIKE operator (internally translated to ~~) is overloaded. Note
that this is only a temporary solution until Icinga DB Web provides
column type support.
Before:
idb=# select * from icingadb_instance where responsible = 'y';
ERROR: operator does not exist: boolenum = unknown
LINE 1: select * from icingadb_instance where responsible = 'y';
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
idb=#
refs #136