From 3120b7cbcb60cee27484874c579054c2b6d04c42 Mon Sep 17 00:00:00 2001 From: Jacek Date: Mon, 14 Jun 2021 11:33:05 +0200 Subject: [PATCH] SONAR-14792 Move MsSQL helper out specific DB migration version --- .../DropMsSQLDefaultConstraintsBuilder.java | 2 +- .../v85/DropUnusedPeriodsInSnapshots.java | 2 +- ...DropUnusedVariationsInProjectMeasures.java | 2 +- .../version/v85/util/package-info.java | 23 ------------------- ...ropMsSQLDefaultConstraintsBuilderTest.java | 3 ++- 5 files changed, 5 insertions(+), 27 deletions(-) rename server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/{version/v85/util => sql}/DropMsSQLDefaultConstraintsBuilder.java (98%) delete mode 100644 server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v85/util/package-info.java rename server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/{version/v85/util => sql}/DropMsSQLDefaultConstraintsBuilderTest.java (95%) diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v85/util/DropMsSQLDefaultConstraintsBuilder.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/sql/DropMsSQLDefaultConstraintsBuilder.java similarity index 98% rename from server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v85/util/DropMsSQLDefaultConstraintsBuilder.java rename to server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/sql/DropMsSQLDefaultConstraintsBuilder.java index f24409a719c..7b6d3e652ce 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v85/util/DropMsSQLDefaultConstraintsBuilder.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/sql/DropMsSQLDefaultConstraintsBuilder.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.server.platform.db.migration.version.v85.util; +package org.sonar.server.platform.db.migration.sql; import com.google.common.base.Preconditions; import java.sql.Connection; diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v85/DropUnusedPeriodsInSnapshots.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v85/DropUnusedPeriodsInSnapshots.java index 92766d6a684..1f6d780374c 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v85/DropUnusedPeriodsInSnapshots.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v85/DropUnusedPeriodsInSnapshots.java @@ -24,7 +24,7 @@ import org.sonar.db.Database; import org.sonar.db.dialect.MsSql; import org.sonar.server.platform.db.migration.sql.DropColumnsBuilder; import org.sonar.server.platform.db.migration.step.DdlChange; -import org.sonar.server.platform.db.migration.version.v85.util.DropMsSQLDefaultConstraintsBuilder; +import org.sonar.server.platform.db.migration.sql.DropMsSQLDefaultConstraintsBuilder; public class DropUnusedPeriodsInSnapshots extends DdlChange { private static final String TABLE_NAME = "snapshots"; diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v85/DropUnusedVariationsInProjectMeasures.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v85/DropUnusedVariationsInProjectMeasures.java index 03074f729e6..1c42f6f47f1 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v85/DropUnusedVariationsInProjectMeasures.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v85/DropUnusedVariationsInProjectMeasures.java @@ -24,7 +24,7 @@ import org.sonar.db.Database; import org.sonar.db.dialect.MsSql; import org.sonar.server.platform.db.migration.sql.DropColumnsBuilder; import org.sonar.server.platform.db.migration.step.DdlChange; -import org.sonar.server.platform.db.migration.version.v85.util.DropMsSQLDefaultConstraintsBuilder; +import org.sonar.server.platform.db.migration.sql.DropMsSQLDefaultConstraintsBuilder; public class DropUnusedVariationsInProjectMeasures extends DdlChange { private static final String TABLE_NAME = "project_measures"; diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v85/util/package-info.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v85/util/package-info.java deleted file mode 100644 index 47e5dbaf629..00000000000 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v85/util/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -@ParametersAreNonnullByDefault -package org.sonar.server.platform.db.migration.version.v85.util; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v85/util/DropMsSQLDefaultConstraintsBuilderTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/sql/DropMsSQLDefaultConstraintsBuilderTest.java similarity index 95% rename from server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v85/util/DropMsSQLDefaultConstraintsBuilderTest.java rename to server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/sql/DropMsSQLDefaultConstraintsBuilderTest.java index 0f15f94c19c..9aa6d65b95d 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v85/util/DropMsSQLDefaultConstraintsBuilderTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/sql/DropMsSQLDefaultConstraintsBuilderTest.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.server.platform.db.migration.version.v85.util; +package org.sonar.server.platform.db.migration.sql; import java.sql.Connection; import java.sql.PreparedStatement; @@ -29,6 +29,7 @@ import org.sonar.db.dialect.H2; import org.sonar.db.dialect.MsSql; import org.sonar.db.dialect.Oracle; import org.sonar.db.dialect.PostgreSql; +import org.sonar.server.platform.db.migration.sql.DropMsSQLDefaultConstraintsBuilder; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.anyString; -- 2.39.5