-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CORE-227] Only insert into AUDIT_WORKFLOW_STATUS when the workflow s…
…tatus changes (#3155)
- Loading branch information
1 parent
c5560b5
commit 8281027
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...sde/rawls/liquibase/changesets/20241218_alter_audit_workflow_status_trigger_frequency.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<databaseChangeLog logicalFilePath="dummy" xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.30.xsd"> | ||
<changeSet id="alter_audit_workflow_status_trigger_frequency" author="mtalbott" logicalFilePath="dummy"> | ||
<sql> | ||
DROP TRIGGER IF EXISTS after_workflow_update; | ||
</sql> | ||
<sql splitStatements="false"> | ||
CREATE TRIGGER after_workflow_update | ||
AFTER UPDATE ON WORKFLOW | ||
FOR EACH ROW | ||
BEGIN | ||
IF NEW.STATUS != OLD.STATUS THEN | ||
INSERT INTO AUDIT_WORKFLOW_STATUS | ||
(workflow_id, status, timestamp) | ||
VALUES | ||
(NEW.ID, NEW.STATUS, NEW.STATUS_LAST_CHANGED); | ||
END IF; | ||
END | ||
</sql> | ||
</changeSet> | ||
</databaseChangeLog> |