diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2017-05-24 16:31:42 +0200 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2017-05-26 17:27:12 +0200 |
commit | 2bbb7bb6b9c1937a459adfe22f84d835a687fec7 (patch) | |
tree | 4a8a51c48b675759895a98cfd8aecc105757a250 /server/sonar-db-migration/src/main/java/org | |
parent | 8cd57ce8858b6229246c2a96dff5daf5bf0050fc (diff) | |
download | sonarqube-2bbb7bb6b9c1937a459adfe22f84d835a687fec7.tar.gz sonarqube-2bbb7bb6b9c1937a459adfe22f84d835a687fec7.zip |
SONAR-9028 remove table authors from DB
Diffstat (limited to 'server/sonar-db-migration/src/main/java/org')
4 files changed, 97 insertions, 0 deletions
diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/MigrationConfigurationModule.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/MigrationConfigurationModule.java index 24703072210..25f9b7e35b5 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/MigrationConfigurationModule.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/MigrationConfigurationModule.java @@ -30,6 +30,7 @@ import org.sonar.server.platform.db.migration.version.v61.DbVersion61; import org.sonar.server.platform.db.migration.version.v62.DbVersion62; import org.sonar.server.platform.db.migration.version.v63.DbVersion63; import org.sonar.server.platform.db.migration.version.v64.DbVersion64; +import org.sonar.server.platform.db.migration.version.v65.DbVersion65; public class MigrationConfigurationModule extends Module { @Override @@ -43,6 +44,7 @@ public class MigrationConfigurationModule extends Module { DbVersion62.class, DbVersion63.class, DbVersion64.class, + DbVersion65.class, // migration steps MigrationStepRegistryImpl.class, diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v65/DbVersion65.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v65/DbVersion65.java new file mode 100644 index 00000000000..f379342aa4a --- /dev/null +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v65/DbVersion65.java @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2017 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. + */ + +package org.sonar.server.platform.db.migration.version.v65; + +import org.sonar.server.platform.db.migration.step.MigrationStepRegistry; +import org.sonar.server.platform.db.migration.version.DbVersion; + +public class DbVersion65 implements DbVersion { + @Override + public void addSteps(MigrationStepRegistry registry) { + registry + .add(1700, "Drop table AUTHORS", DropTableAuthors.class); + } +} diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v65/DropTableAuthors.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v65/DropTableAuthors.java new file mode 100644 index 00000000000..54f34a3ae83 --- /dev/null +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v65/DropTableAuthors.java @@ -0,0 +1,38 @@ +/* + * SonarQube + * Copyright (C) 2009-2017 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. + */ +package org.sonar.server.platform.db.migration.version.v65; + +import java.sql.SQLException; +import org.sonar.db.Database; +import org.sonar.server.platform.db.migration.sql.DropIndexBuilder; +import org.sonar.server.platform.db.migration.sql.DropTableBuilder; +import org.sonar.server.platform.db.migration.step.DdlChange; + +public class DropTableAuthors extends DdlChange { + public DropTableAuthors(Database db) { + super(db); + } + + @Override + public void execute(Context context) throws SQLException { + context.execute(new DropIndexBuilder(getDialect()).setTable("authors").setName("uniq_author_logins").build()); + context.execute(new DropTableBuilder(getDialect(), "authors").build()); + } +} diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v65/package-info.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v65/package-info.java new file mode 100644 index 00000000000..5ccfc875aaa --- /dev/null +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v65/package-info.java @@ -0,0 +1,25 @@ +/* + * SonarQube + * Copyright (C) 2009-2017 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.v65; + +import javax.annotation.ParametersAreNonnullByDefault; + |