aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacek <jacek.poreda@sonarsource.com>2021-01-12 08:19:30 +0100
committersonartech <sonartech@sonarsource.com>2021-01-12 20:26:06 +0000
commitdf9f136ff0ebffba8e32b98c100da9923deb6f0a (patch)
treefb9c0991f32e9ab295def005b307c34a11c3655e
parentc1f4f7790c70830e2f199751acb3006e31141bc7 (diff)
downloadsonarqube-df9f136ff0ebffba8e32b98c100da9923deb6f0a.tar.gz
sonarqube-df9f136ff0ebffba8e32b98c100da9923deb6f0a.zip
SONAR-14245 Drop 'organization_webhook' index before dropping 'organization_uuid' column in 'webhooks' table
-rw-r--r--server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v87/DropOrganizationInWebhooks.java1
-rw-r--r--server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v87/DropOrganizationInWebhooksTest.java1
2 files changed, 2 insertions, 0 deletions
diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v87/DropOrganizationInWebhooks.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v87/DropOrganizationInWebhooks.java
index 3fdc88af4de..f310d3a9362 100644
--- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v87/DropOrganizationInWebhooks.java
+++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v87/DropOrganizationInWebhooks.java
@@ -34,6 +34,7 @@ public class DropOrganizationInWebhooks extends DdlChange {
@Override
public void execute(Context context) throws SQLException {
+ context.execute(new DropIndexBuilder(getDialect()).setTable(TABLE_NAME).setName("organization_webhook").build());
context.execute(new DropIndexBuilder(getDialect()).setTable(TABLE_NAME).setName("project_webhook").build());
context.execute(new DropColumnsBuilder(getDialect(), TABLE_NAME, "organization_uuid").build());
diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v87/DropOrganizationInWebhooksTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v87/DropOrganizationInWebhooksTest.java
index be010b8693c..d5545ae3f51 100644
--- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v87/DropOrganizationInWebhooksTest.java
+++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v87/DropOrganizationInWebhooksTest.java
@@ -34,6 +34,7 @@ public class DropOrganizationInWebhooksTest {
@Test
public void column_has_been_dropped() throws SQLException {
underTest.execute();
+ dbTester.assertIndexDoesNotExist("webhooks", "organization_webhook");
dbTester.assertIndexDoesNotExist("webhooks", "project_webhook");
dbTester.assertColumnDoesNotExist("webhooks", "organization_uuid");
}