Augustin Trancart 061b810dac Fix behaviour of triggers when logging an existing layer
When adding logging via db manager to an existing layer, all the
time_start of existing features are still null. When we modify one
feature for the first time, the update trigger fires and insert a row
for the past state of the feature. In turn, this fires the INSERT
trigger for this row, and the execution goes inside the `if
NEW.time_start is NULL`, which set the end timestamp to NULL, making the
old row still visible in the _current view.

In other word, the insert trigger makes the assumption that a null start
timestamp means now, which is not true in the case described above.

This commit fixes this assumption by initially setting it to `-infinity`
for existing rows.
2021-10-06 12:00:39 +10:00
..