mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 18:42:30 +03:00
a3e6b1c741
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2634 Co-authored-by: Naveen Naidu <30195193+Naveenaidu@users.noreply.github.com> GitOrigin-RevId: 29567fa336c22d1812dfcfa6294f54e74a741f0c
18 lines
467 B
Plaintext
18 lines
467 B
Plaintext
CREATE OR ALTER TRIGGER #{qualifiedTriggerName}
|
|
ON #{qualifiedTableName}
|
|
AFTER UPDATE
|
|
AS
|
|
BEGIN
|
|
DECLARE @json NVARCHAR(MAX)
|
|
SET @json = (
|
|
SELECT #{oldDeliveryColsSQLExp}, #{newDeliveryColsSQLExp}
|
|
FROM DELETED
|
|
JOIN INSERTED
|
|
ON #{primaryKeyJoinExp}
|
|
#{listenColumnExp}
|
|
FOR JSON PATH
|
|
)
|
|
insert into hdb_catalog.event_log (schema_name,table_name,trigger_name, payload)
|
|
select '#{schemaName}','#{tableName}','#{triggerNameText}', value from OPENJSON (@json)
|
|
END
|