diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2020-05-01 11:17:38 -0500 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-05-25 20:05:21 +0000 |
commit | 16b2b85fc200856e65175663bbe2477012be9275 (patch) | |
tree | fb11f07b89e3c20da338cfa980d70b4a8d716609 /server/sonar-db-migration | |
parent | 85b940dd935f57860f26dff7f1bfaa9de1ba8af2 (diff) | |
download | sonarqube-16b2b85fc200856e65175663bbe2477012be9275.tar.gz sonarqube-16b2b85fc200856e65175663bbe2477012be9275.zip |
SONAR-13221 Update method and var names
Diffstat (limited to 'server/sonar-db-migration')
6 files changed, 0 insertions, 213 deletions
diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v83/groups/AddPrimaryKeyOnUuidColumnOfMetricsTable.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v83/groups/AddPrimaryKeyOnUuidColumnOfMetricsTable.java deleted file mode 100644 index ac7307dab17..00000000000 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v83/groups/AddPrimaryKeyOnUuidColumnOfMetricsTable.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 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.v83.groups; - -import java.sql.SQLException; -import org.sonar.db.Database; -import org.sonar.server.platform.db.migration.step.DdlChange; -import org.sonar.server.platform.db.migration.version.v83.util.AddPrimaryKeyBuilder; - -public class AddPrimaryKeyOnUuidColumnOfMetricsTable extends DdlChange { - - public AddPrimaryKeyOnUuidColumnOfMetricsTable(Database db) { - super(db); - } - - @Override - public void execute(Context context) throws SQLException { - context.execute(new AddPrimaryKeyBuilder("metrics", "uuid").build()); - } - -} diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v83/groups/AddUuidColumnToMetricsTable.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v83/groups/AddUuidColumnToMetricsTable.java deleted file mode 100644 index 76c2ae9ebcd..00000000000 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v83/groups/AddUuidColumnToMetricsTable.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 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.v83.groups; - -import org.sonar.db.Database; -import org.sonar.server.platform.db.migration.version.v83.common.AddUuidColumnToTable; - -public class AddUuidColumnToMetricsTable extends AddUuidColumnToTable { - private static final String TABLE = "metrics"; - - public AddUuidColumnToMetricsTable(Database db) { - super(db, TABLE); - } -} diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v83/groups/DropIdColumnOfMetricsTable.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v83/groups/DropIdColumnOfMetricsTable.java deleted file mode 100644 index 84521e8fa94..00000000000 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v83/groups/DropIdColumnOfMetricsTable.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 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.v83.groups; - -import org.sonar.db.Database; -import org.sonar.server.platform.db.migration.version.v83.common.DropIdColumn; - -public class DropIdColumnOfMetricsTable extends DropIdColumn { - private static final String TABLE = "metrics"; - - public DropIdColumnOfMetricsTable(Database db) { - super(db, TABLE); - } -} diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v83/groups/DropPrimaryKeyOnIdColumnOfMetricsTable.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v83/groups/DropPrimaryKeyOnIdColumnOfMetricsTable.java deleted file mode 100644 index 3e84e48820b..00000000000 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v83/groups/DropPrimaryKeyOnIdColumnOfMetricsTable.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 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.v83.groups; - -import org.sonar.db.Database; -import org.sonar.server.platform.db.migration.version.v83.common.DropPrimaryKeyOnIdColumn; -import org.sonar.server.platform.db.migration.version.v83.util.DropPrimaryKeySqlGenerator; - -public class DropPrimaryKeyOnIdColumnOfMetricsTable extends DropPrimaryKeyOnIdColumn { - private static final String TABLE_NAME = "metrics"; - - public DropPrimaryKeyOnIdColumnOfMetricsTable(Database db, DropPrimaryKeySqlGenerator dropPrimaryKeySqlGenerator) { - super(db, dropPrimaryKeySqlGenerator, TABLE_NAME); - } -} diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v83/groups/MakeMetricsUuidColumnNotNullable.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v83/groups/MakeMetricsUuidColumnNotNullable.java deleted file mode 100644 index cf3fda69fdb..00000000000 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v83/groups/MakeMetricsUuidColumnNotNullable.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 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.v83.groups; - -import org.sonar.db.Database; -import org.sonar.server.platform.db.migration.version.v83.common.MakeUuidColumnNotNullable; - -public class MakeMetricsUuidColumnNotNullable extends MakeUuidColumnNotNullable { - private static final String TABLE = "metrics"; - - public MakeMetricsUuidColumnNotNullable(Database db) { - super(db, TABLE); - } -} diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v83/groups/PopulateMetricsUuid.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v83/groups/PopulateMetricsUuid.java deleted file mode 100644 index 6617b5cfb30..00000000000 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v83/groups/PopulateMetricsUuid.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 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.v83.groups; - -import java.sql.SQLException; -import org.sonar.core.util.UuidFactory; -import org.sonar.db.Database; -import org.sonar.server.platform.db.migration.step.DataChange; -import org.sonar.server.platform.db.migration.step.MassUpdate; - -public class PopulateMetricsUuid extends DataChange { - - private final UuidFactory uuidFactory; - - public PopulateMetricsUuid(Database db, UuidFactory uuidFactory) { - super(db); - this.uuidFactory = uuidFactory; - } - - @Override - protected void execute(Context context) throws SQLException { - MassUpdate massUpdate = context.prepareMassUpdate(); - - massUpdate.select("select id from metrics where uuid is null order by id asc"); - massUpdate.update("update metrics set uuid = ? where id = ?"); - - massUpdate.execute((row, update) -> { - update.setString(1, uuidFactory.create()); - update.setLong(2, row.getLong(1)); - return true; - }); - } -} |