Commit 68ed5cd
committed
Parameterise auto_variables_triggers.
The `auto_variables_triggers` function is used to generate PostgreSQL triggers
to update some fields automatically. Currently it is triggered when any field
changes. For PB-1403 we want at least one of these triggers to be conditional
on specific fields.
This change replaces the raw-SQL-based `Condition('OLD.* IS DISTINCT FROM NEW.*')`
with `AnyChange(fields)`. This is equivalent as long as `fields` is empty. We
also update `auto_variables_triggers` to take a new optional `fields` argument
(defaulting to empty). This allows callers to define the conditions that apply
for the trigger.
A later change will make use of this new parametre.1 parent 900c5ed commit 68ed5cd
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
0 commit comments