3 * Copyright (C) 2009-2024 SonarSource SA
4 * mailto:info AT sonarsource DOT com
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 package org.sonar.server.platform.db.migration.version.v107;
22 import org.sonar.server.platform.db.migration.step.MigrationStepRegistry;
23 import org.sonar.server.platform.db.migration.version.DbVersion;
25 // ignoring bad number formatting, as it's indented that we align the migration numbers to SQ versions
26 @SuppressWarnings("java:S3937")
27 public class DbVersion107 implements DbVersion {
30 * We use the start of the 10.X cycle as an opportunity to align migration numbers with the SQ version number.
31 * Please follow this pattern:
41 public void addSteps(MigrationStepRegistry registry) {
43 .add(10_7_000, "Create 'telemetry_metrics_sent' table", CreateTelemetryMetricsSentTable.class)
44 .add(10_7_001, "sonar.auth.gitlab.userConsentForPermissionProvisioningRequired", AddUserConsentRequiredIfGitlabAutoProvisioningEnabled.class)
45 .add(10_7_002, "Migrate SMTP configuration into internal_properties", MigrateSmtpConfiguration.class)
46 .add(10_7_003, "Drop 'github_perms_mapping' table if exists and 'devops_perms_mapping' table exists", DropGithubPermsMappingTableIfDevopsPermsMappingTableExists.class)
47 .add(10_7_004, "Rename 'github_perms_mapping' table to 'devops_perms_mapping'", RenameGithubPermsMappingTable.class)
48 .add(10_7_005, "Rename 'github_role' column to 'devops_platform_role' in devops_perms_mapping", RenameGithubRoleInDevopsPermsMapping.class)
49 .add(10_7_006, "Add 'devops_platform' column to 'devops_perms_mapping' table", AddDevopsPlatformColumnInDevopsPermsMapping.class)
50 .add(10_7_007, "Drop constraint on 'uuid' for 'devops_perms_mapping' table", DropPrimaryKeyOnDevopsPermsMappingTable.class)
51 .add(10_7_008, "Create primary key on 'devops_perms_mapping.uuid'", CreatePrimaryKeyConstraintOnDevopsPermsMappingTable.class)
52 .add(10_7_009, "Drop index 'uniq_github_perm_mappings' in the 'devops_perms_mapping' table", DropIndexUniqGithubPermsMappingInDevopsPermsMappingTable.class)
53 .add(10_7_010, "Create uniq index on 'devops_perms_mapping' table for columns 'devops_platform_role', 'sonarqube_permission' and 'devops_platform'",
54 CreateUniqueIndexOnDevopsPermsMappingTable.class)
55 .add(10_7_011, "Add default permissions for GitLab in 'devops_perms_mapping'", PopulateGitlabDevOpsPermissionsMapping.class);