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.