From c31122579cad10b5a9612de2dc0fbbd011119a98 Mon Sep 17 00:00:00 2001 From: Trong Huu Nguyen Date: Fri, 16 Aug 2024 13:26:34 +0200 Subject: [PATCH] fix: correct migration for audit action --- .../0017_update_audit_events_actions.sql | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 internal/database/migrations/0017_update_audit_events_actions.sql diff --git a/internal/database/migrations/0017_update_audit_events_actions.sql b/internal/database/migrations/0017_update_audit_events_actions.sql new file mode 100644 index 000000000..135177d0d --- /dev/null +++ b/internal/database/migrations/0017_update_audit_events_actions.sql @@ -0,0 +1,27 @@ +-- +goose Up + +UPDATE audit_events +SET action = 'ADDED' +WHERE + action = 'TEAM_MEMBER_ADDED' + AND resource_type = 'TEAM_MEMBER'; + +UPDATE audit_events +SET action = 'REMOVED' +WHERE + action = 'TEAM_MEMBER_REMOVED' + AND resource_type = 'TEAM_MEMBER'; + +-- +goose Down + +UPDATE audit_events +SET action = 'TEAM_MEMBER_ADDED' +WHERE + action = 'ADDED' + AND resource_type = 'TEAM_MEMBER'; + +UPDATE audit_events +SET action = 'TEAM_MEMBER_REMOVED' +WHERE + action = 'REMOVED' + AND resource_type = 'TEAM_MEMBER';