Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CORE-227] Only insert into AUDIT_WORKFLOW_STATUS when the workflow status changes #3155

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,5 @@
<include file="changesets/20241106_streamline_workspace_attr_temp_table_procedure.xml" relativeToChangelogFile="true"/>
<include file="changesets/20241120_rename_submission_cost_cap_threshold.xml" relativeToChangelogFile="true"/>
<include file="changesets/20241121_billing_account_changes_status.xml" relativeToChangelogFile="true"/>
<include file="changesets/20241218_alter_audit_workflow_status_trigger_frequency.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
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>
Loading