3 * Copyright (C) 2009-2017 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.v60;
22 import java.util.stream.Stream;
23 import org.sonar.server.platform.db.migration.step.MigrationStepRegistry;
24 import org.sonar.server.platform.db.migration.version.DbVersion;
26 public class DbVersion60 implements DbVersion {
28 public Stream<Object> getSupportComponents() {
31 FixProjectUuidOfDeveloperProjects.class,
32 CleanUsurperRootComponents.class);
36 public void addSteps(MigrationStepRegistry registry) {
38 .add(1200, "Create table PERM_TPL_CHARACTERISTICS", CreatePermTemplatesCharacteristics.class)
39 .add(1201, "Add columns RESOURCE_INDEX.*_UUID", AddUuidColumnsToResourceIndex.class)
40 .add(1202, "Populate columns RESOURCE_INDEX.*_UUID", PopulateUuidColumnsOfResourceIndex.class)
41 .add(1203, "Clean orphan rows in RESOURCE_INDEX", CleanOrphanRowsInResourceIndex.class)
42 .add(1204, "Make columns RESOURCE_INDEX.*_UUID not nullable", MakeUuidColumnsNotNullOnResourceIndex.class)
43 .add(1205, "Make column RESOURCE_INDEX.resource_index_rid", DropResourceIndexRidFromResourceIndex.class)
44 .add(1206, "Drop columns RESOURCE_INDEX.*_ID", DropIdColumnsFromResourceIndex.class)
45 .add(1207, "Drop unused columns on PROJECT_MEASURES", DropUnusedMeasuresColumns.class)
46 .add(1208, "Add columns SNAPSHOTS.*COMPONENT_UUID", AddComponentUuidColumnsToSnapshots.class)
47 .add(1209, "Populate column SNAPSHOTS.*COMPONENT_UUID", PopulateComponentUuidColumnsOfSnapshots.class)
48 .add(1210, "Create temporary indices for migration 1211", CreateTemporaryIndicesFor1211.class)
49 .add(1211, "Clean orphan rows in SNAPSHOTS", CleanOrphanRowsInSnapshots.class)
50 .add(1212, "Drop temporary indices for migration 1211", DropTemporaryIndicesOf1210.class)
51 .add(1213, "Make column SNAPSHOTS.UUID not nullable", MakeComponentUuidColumnsNotNullOnSnapshots.class)
52 .add(1214, "Drop columns SNAPSHOTS.SNAPSHOT_*_ID", DropSnapshotProjectIdFromSnapshots.class)
53 .add(1215, "Drop columns SNAPSHOTS.*_ID", DropIdColumnsFromSnapshots.class)
54 .add(1216, "Add column PROJECT_MEASURES.COMPONENT_UUID", AddComponentUuidColumnToMeasures.class)
55 .add(1217, "Populate column PROJECT_MEASURES.COMPONENT_UUID", PopulateComponentUuidOfMeasures.class)
56 .add(1218, "Delete orphan measures without component", DeleteOrphanMeasuresWithoutComponent.class)
57 .add(1219, "Make column PROJECT_MEASURES.COMPONENT_UUID not nullable", MakeComponentUuidNotNullOnMeasures.class)
58 .add(1220, "Drop column PROJECT_MEASURES.PROJECT_ID", DropProjectIdColumnFromMeasures.class)
59 .add(1221, "Add index measures_component_uuid", AddIndexOnComponentUuidOfMeasures.class)
60 .add(1222, "Drop columns USERS.REMEMBER_TOKEN_*", DropRememberMeColumnsFromUsers.class)
61 .add(1223, "Clean orphan rows and fix incorrect data in table PROJECTS", Migration1223.class)
62 .add(1224, "Add columns PROJECTS.*_UUID", AddUuidColumnsToProjects.class)
63 .add(1225, "Populate columns PROJECTS.*_UUID", PopulateUuidColumnsOfProjects.class)
64 .add(1226, "Clean orphan rows in table PROJECTS", CleanOrphanRowsInProjects.class)
65 .add(1227, "Drop index projects_uuid", DropIndexProjectsUuidFromProjects.class)
66 .add(1228, "Make columns PROJECTS.*_UUID not nullable", MakeUuidColumnsNotNullOnProjects.class)
67 .add(1229, "Recreate index projects_uuid", RecreateIndexProjectsUuidFromProjects.class)
68 .add(1230, "Drop index projects_root_id", DropIndexProjectsRootIdFromProjects.class)
69 .add(1231, "Drop columns PROJECTS.*_ID", DropIdColumnsFromProjects.class)
70 .add(1232, "Add column SNAPSHOTS.UUID", AddUuidColumnToSnapshots.class)
71 .add(1233, "Populate column SNAPSHOTS.UUID", PopulateUuidColumnOnSnapshots.class)
72 .add(1234, "Make column SNAPSHOTS.UUID not nullable", MakeUuidColumnNotNullOnSnapshots.class)
73 .add(1235, "Add unique index analyses_uuid", AddUniqueIndexOnUuidOfSnapshots.class)
74 .add(1236, "Add column CE_ACTIVITY.ANALYSIS_UUID", AddAnalysisUuidColumnToCeActivity.class)
75 .add(1237, "Populate column CE_ACTIVITY.ANALYSIS_UUID", PopulateAnalysisUuidColumnOnCeActivity.class)
76 .add(1238, "Drop column CE_ACTIVITY.SNAPSHOT_ID", DropSnapshotIdColumnFromCeActivity.class)
77 .add(1239, "Add columns DUPLICATION_INDEX.*_UUID", AddComponentUuidAndAnalysisUuidColumnToDuplicationsIndex.class)
78 .add(1240, "Populate columns DUPLICATION_INDEX.*_UUID", PopulateComponentUuidAndAnalysisUuidOfDuplicationsIndex.class)
79 .add(1241, "Clean orphan rows in table DUPLICATION_INDEX", DeleteOrphanDuplicationsIndexRowsWithoutComponentOrAnalysis.class)
80 .add(1242, "Make columns DUPLICATION_INDEX.*_UUID not nullable", MakeComponentUuidAndAnalysisUuidNotNullOnDuplicationsIndex.class)
81 .add(1243, "Drop index duplications_index_sid", DropIndexDuplicationsIndexSidFromDuplicationsIndex.class)
82 .add(1244, "Drop columns DUPLICATION_INDEX.*SNAPSHOT_ID", DropSnapshotIdColumnsFromDuplicationsIndex.class)
83 .add(1246, "Add column RULES_PROFILES.LAST_USED", AddLastUsedColumnToRulesProfiles.class)
84 .add(1247, "Populate column RULES_PROFILES.LAST_USED", PopulateLastUsedColumnOfRulesProfiles.class)
85 .add(1248, "Add column EVENTS.ANALYSIS_UUID", AddAnalysisUuidColumnToEvents.class)
86 .add(1249, "Populate column EVENTS.ANALYSIS_UUID", PopulateAnalysisUuidOnEvents.class)
87 .add(1250, "Clean events without analysis_uuid", CleanEventsWithoutAnalysisUuid.class)
88 .add(1251, "Clean events without snapshot_id", CleanEventsWithoutSnapshotId.class)
89 .add(1252, "Make column EVENTS.ANALYSIS_UUID not nullable", MakeAnalysisUuidNotNullOnEvents.class)
90 .add(1253, "Drop index events_snapshot_id", DropIndexEventsSnapshotIdFromEvents.class)
91 .add(1254, "Drop columns EVENTS.SNAPSHOT_ID", DropSnapshotIdColumnFromEvents.class)
92 .add(1256, "Add column PROJECTS.UUID_PATH", AddUuidPathColumnToProjects.class)
93 .add(1257, "Populate column PROJECTS.UUID_PATH", PopulateUuidPathColumnOnProjects.class)
94 .add(1258, "Make column PROJECTS.UUID_PATH not nullable", MakeUuidPathColumnNotNullOnProjects.class)
95 .add(1259, "Remove password of non local users", RemoveUsersPasswordWhenNotLocal.class)
96 .add(1260, "Add column ACTIVITIES.PROFILE_KEY", AddProfileKeyToActivities.class)
97 .add(1261, "Populate column ACTIVITIES.PROFILE_KEY", PopulateProfileKeyOfActivities.class)
98 .add(1262, "Make column ACTIVITIES.PROFILE_KEY not nullable", MakeProfileKeyNotNullOnActivities.class)
99 .add(1263, "Add column RULES_PROFILES.USER_UPDATED_AT", AddUserUpdatedAtToRulesProfiles.class)
100 .add(1264, "Populate column RULES_PROFILES.USER_UPDATED_AT", PopulateUserUpdatedAtOfRulesProfiles.class)
101 .add(1265, "Add column PROJECT_MEASURES.ANALYSIS_UUID", AddAnalysisUuidColumnToMeasures.class)
102 .add(1266, "Add index measures_analysis_metric", AddIndexOnAnalysisUuidOfMeasures.class)
103 .add(1267, "Populate column PROJECT_MEASURES.ANALYSIS_UUID", PopulateAnalysisUuidOnMeasures.class)
104 .add(1268, "Clean orphan measures", CleanMeasuresWithNullAnalysisUuid.class)
105 .add(1269, "Temporary drop of index measures_analysis_metric", TemporarilyDropIndexOfAnalysisUuidOnMeasures.class)
106 .add(1270, "Make column PROJECT_MEASURES.ANALYSIS_UUID not nullable", MakeAnalysisUuidNotNullOnMeasures.class)
107 .add(1271, "Restore index measures_analysis_metric", AddIndexOnAnalysisUuidOfMeasures.class)
108 .add(1272, "Delete snapshots but the one of root components", DropTreesOfSnapshots.class)
109 .add(1273, "Drop indices on tree columns of table SNAPSHOTS", DropIndicesOnTreeColumnsOfSnapshots.class)
110 .add(1274, "Drop tree columns of table SNAPSHOTS", DropTreeColumnsFromSnapshots.class)
111 .add(1275, "Drop index measures_sid_metric", DropIndexOnSnapshotIdOfMeasures.class)
112 .add(1276, "Drop column PROJECT_MEASURES.SNAPSHOT_ID", DropSnapshotIdColumnFromMeasures.class)
113 .add(1277, "Add columns PROJECTS.B_*", AddBColumnsToProjects.class);