Drop some superfluous Redis -> DB value mappings#964
Conversation
9f60050 to
85b55ab
Compare
oxzi
left a comment
There was a problem hiding this comment.
First, thanks for this PR. In general, it looks good.
I went over the code - and its counterpart in Icinga 2 - multiple times and added some small comments.
Furthermore, I did some testing in a playground setup and clicking a non-sticky and a sticky in Icinga DB Web resulted in the expected data within the relation database.
MariaDB [icingadb]> select comment.text, is_acknowledged, is_sticky_acknowledgement from service_state join comment on service_state.acknowledgement_comment_id = comment.id where is_acknowledged = 'y'\G
*************************** 1. row ***************************
text: F
is_acknowledged: y
is_sticky_acknowledgement: n
*************************** 2. row ***************************
text: sticky F
is_acknowledged: y
is_sticky_acknowledgement: y
2 rows in set (0.004 sec)
85b55ab to
ca18d4c
Compare
oxzi
left a comment
There was a problem hiding this comment.
Looks good so far, thanks!
After this PR's counterpart against Icinga 2 was properly reviewed and merged, I would take another look. Consider this a soft approve.
However, my comment regarding the different column order in PostgreSQL remains; #964 (comment). I would like to hear some opinions if we should resolve this or treat this as an annoyance to be ignored.
ca18d4c to
3a20d8d
Compare
dd51836 to
7b2fd34
Compare
5026371 to
7fdc513
Compare
d15e93d to
0b5af71
Compare
50f67f6 to
7cf3c9c
Compare
|
That was my final push :). So please have another look again! |
7cf3c9c to
c7da5ed
Compare
Icinga 2 sets now the `state_type` field to either `hard` or `soft`, thus the mappings within the Icinga DB code is no longer needed.
c7da5ed to
c6a569e
Compare
c6a569e to
ea17fa4
Compare
oxzi
left a comment
There was a problem hiding this comment.
LGTM.
Went over the code another time, tested it together with Icinga 2 based on your other PR, tested updated icingadb-migrate command. Nothing fell apart. Thanks!
This PR is basically the same as Icinga/icinga2#10452 and removes the now superfluous Redis -> DB value mappings, and also makes the
{host,service}_state.is_acknowledgedcolumn a simpleboolenumand introduces a newis_sticky_acknowledgementcolumn to indicate sticky acknowledgements.Requires