Skip to content

Commit

Permalink
Fix versionadded directive
Browse files Browse the repository at this point in the history
  • Loading branch information
raddevon committed May 9, 2024
1 parent 0aa1baf commit 01af42a
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions docs/reference/ddl/triggers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,24 @@ Declare a trigger that inserts a ``Log`` object for each new ``User`` object:
);
};
..versionadded:: 4.0

Declare a trigger that inserts a ``Log`` object conditionally when an update
query makes a change to a ``User`` object:

.. code-block:: edgeql
alter type User {
create trigger log_update after update for each
when (<json>__old__ {**} != <json>__new__ {**})
do (
insert Log {
action := 'update',
target_name := __new__.name,
change := __old__.name ++ '->' ++ __new__.name
.. versionadded:: 4.0

Declare a trigger that inserts a ``Log`` object conditionally when an update
query makes a change to a ``User`` object:

.. code-block:: edgeql
alter type User {
create trigger log_update after update for each
when (<json>__old__ {**} != <json>__new__ {**})
do (
insert Log {
action := 'update',
target_name := __new__.name,
change := __old__.name ++ '->' ++ __new__.name
}
);
}
);
}
Drop trigger
Expand Down

0 comments on commit 01af42a

Please sign in to comment.