From bb202bbc93e6e8ff0896dba53bd32fac7a6e2944 Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Tue, 30 Jul 2024 12:53:09 -0700 Subject: [PATCH] fix: DB migration fails with AWS RDS MySQL 5.7 - issue: the "DROP TRIGGER" step of our MySQL DB migration fails when used with AWS RDS MySQL 5.7 due to: ``` (conn=127) You do not have the SUPER privilege and binary logging is enabled ``` - We decided that the best approach is to just remove this migration step, even though modifying past migrations is not recommended by flyway (but in the past, in our context removing migration steps have not created any problems). - Note: This removal comes with a small problem where the triggers in question are not removed (because we do want these triggers to be removed, since they are not compatible with our latest code in terms of DB cleanup, see: https://github.com/cloudfoundry/credhub/pull/728). However, this problematic scenario should be quite narrow (only for users who have successfully installed CredHub 2.12.67, which adds the triggers, and have never upgraded to any versions between 2.12.69 and the latest current version (2.12.84), which contains the "DROP TRIGGER" step). For these users, we will publish docs on how to fix it (manually drop the triggers). [#187774971] --- .../resources/db/migration/mysql/V58__remove_triggers.sql | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 applications/credhub-api/src/main/resources/db/migration/mysql/V58__remove_triggers.sql diff --git a/applications/credhub-api/src/main/resources/db/migration/mysql/V58__remove_triggers.sql b/applications/credhub-api/src/main/resources/db/migration/mysql/V58__remove_triggers.sql deleted file mode 100644 index 7ce0bbab5..000000000 --- a/applications/credhub-api/src/main/resources/db/migration/mysql/V58__remove_triggers.sql +++ /dev/null @@ -1,6 +0,0 @@ - -DROP TRIGGER IF EXISTS tr_credential_version_pre_del; - -DROP TRIGGER IF EXISTS tr_credential_version_post_del; - -DROP TRIGGER IF EXISTS tr_credential_pre_del;