From 543e7cad315546d672e110a769444b3e8ae6049f Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 1 Mar 2016 15:58:40 +0100 Subject: [PATCH] SONAR-7330 fix DB migration --- .../java/org/sonar/db/version/MigrationStepModule.java | 4 ++-- ...Columns.java => DropRulesDatesAndCharacteristics.java} | 4 ++-- ...est.java => DropRulesDatesAndCharacteristicsTest.java} | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) rename sonar-db/src/main/java/org/sonar/db/version/v55/{DropRulesDateColumns.java => DropRulesDatesAndCharacteristics.java} (92%) rename sonar-db/src/test/java/org/sonar/db/version/v55/{DropRulesDateColumnsTest.java => DropRulesDatesAndCharacteristicsTest.java} (87%) diff --git a/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java b/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java index 30ab456009e..ceb4bed0ccc 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java +++ b/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java @@ -74,7 +74,7 @@ import org.sonar.db.version.v55.AddIssuesType; import org.sonar.db.version.v55.AddRulesColumns; import org.sonar.db.version.v55.DeleteMeasuresWithCharacteristicId; import org.sonar.db.version.v55.DropActiveRulesDateColumns; -import org.sonar.db.version.v55.DropRulesDateColumns; +import org.sonar.db.version.v55.DropRulesDatesAndCharacteristics; import org.sonar.db.version.v55.FeedActiveRulesLongDateColumns; import org.sonar.db.version.v55.FeedIssueTypes; import org.sonar.db.version.v55.FeedRulesLongDateColumns; @@ -152,7 +152,7 @@ public class MigrationStepModule extends Module { FeedActiveRulesLongDateColumns.class, AddIssuesType.class, FeedIssueTypes.class, - DropRulesDateColumns.class, + DropRulesDatesAndCharacteristics.class, DropActiveRulesDateColumns.class ); } diff --git a/sonar-db/src/main/java/org/sonar/db/version/v55/DropRulesDateColumns.java b/sonar-db/src/main/java/org/sonar/db/version/v55/DropRulesDatesAndCharacteristics.java similarity index 92% rename from sonar-db/src/main/java/org/sonar/db/version/v55/DropRulesDateColumns.java rename to sonar-db/src/main/java/org/sonar/db/version/v55/DropRulesDatesAndCharacteristics.java index 082f44d6806..5eb37083e1e 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/v55/DropRulesDateColumns.java +++ b/sonar-db/src/main/java/org/sonar/db/version/v55/DropRulesDatesAndCharacteristics.java @@ -30,11 +30,11 @@ import org.sonar.db.version.DropColumnsBuilder; * - created_at * - updated_at */ -public class DropRulesDateColumns extends DdlChange { +public class DropRulesDatesAndCharacteristics extends DdlChange { private final Database db; - public DropRulesDateColumns(Database db) { + public DropRulesDatesAndCharacteristics(Database db) { super(db); this.db = db; } diff --git a/sonar-db/src/test/java/org/sonar/db/version/v55/DropRulesDateColumnsTest.java b/sonar-db/src/test/java/org/sonar/db/version/v55/DropRulesDatesAndCharacteristicsTest.java similarity index 87% rename from sonar-db/src/test/java/org/sonar/db/version/v55/DropRulesDateColumnsTest.java rename to sonar-db/src/test/java/org/sonar/db/version/v55/DropRulesDatesAndCharacteristicsTest.java index 96c357151a8..f45fc6c5c05 100644 --- a/sonar-db/src/test/java/org/sonar/db/version/v55/DropRulesDateColumnsTest.java +++ b/sonar-db/src/test/java/org/sonar/db/version/v55/DropRulesDatesAndCharacteristicsTest.java @@ -28,22 +28,22 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public class DropRulesDateColumnsTest { +public class DropRulesDatesAndCharacteristicsTest { - DropRulesDateColumns migration; + DropRulesDatesAndCharacteristics underTest; Database database; @Before public void setUp() { database = mock(Database.class); - migration = new DropRulesDateColumns(database); + underTest = new DropRulesDatesAndCharacteristics(database); } @Test public void generate_sql_on_postgresql() { when(database.getDialect()).thenReturn(new PostgreSql()); - assertThat(migration.generateSql()).isEqualTo( + assertThat(underTest.generateSql()).isEqualTo( "ALTER TABLE rules DROP COLUMN created_at, DROP COLUMN updated_at, DROP COLUMN characteristic_id, DROP COLUMN default_characteristic_id" ); } -- 2.39.5