From a5ab07be6c4a88715e0747364e2d0c843b1ad90c Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Fri, 15 Jul 2016 10:03:38 +0200 Subject: [PATCH] SONAR-7786 Create index measures_analysis_metric earlier so that other migrations can benefit from it --- .../1210_create_temporary_indices_for_1211.rb | 30 ++++++++++++++ ...=> 1211_clean_orphan_rows_in_snapshots.rb} | 0 .../1212_drop_temporary_indices_of_1210.rb | 40 +++++++++++++++++++ ...ent_uuid_columns_not_null_on_snapshots.rb} | 0 ...rop_snapshot_project_id_from_snapshots.rb} | 0 ...=> 1215_drop_id_columns_from_snapshots.rb} | 0 ...=> 1216_add_component_uuid_to_measures.rb} | 0 ...17_populate_component_uuid_of_measures.rb} | 0 ...lete_orphan_measures_without_component.rb} | 0 ...ke_component_uuid_not_null_on_measures.rb} | 0 ...0_drop_project_id_column_from_measures.rb} | 0 ...dd_index_on_component_uuid_of_measures.rb} | 0 ...22_drop_remember_me_columns_from_users.rb} | 0 ...1223_clean_some_data_in_table_projects.rb} | 0 ...b => 1224_add_uuid_columns_to_projects.rb} | 0 ...1225_populate_uuid_columns_of_projects.rb} | 0 ... => 1226_clean_orphan_rows_in_projects.rb} | 0 ...drop_index_projects_uuid_from_projects.rb} | 0 ...make_uuid_columns_not_null_on_projects.rb} | 0 ...eate_index_projects_uuid_from_projects.rb} | 0 ...p_index_projects_root_id_from_projects.rb} | 0 ... => 1231_drop_id_columns_from_projects.rb} | 0 ...b => 1232_add_uuid_column_to_snapshots.rb} | 0 ...1233_populate_uuid_column_on_snapshots.rb} | 0 ...make_uuid_column_not_null_on_snapshots.rb} | 0 ..._add_unique_index_on_uuid_of_snapshots.rb} | 0 ...dd_analysis_uuid_column_to_ce_activity.rb} | 0 ...te_analysis_uuid_column_on_ce_activity.rb} | 0 ...op_snapshot_id_column_from_ce_activity.rb} | 0 ...nd_analysis_uuid_to_duplications_index.rb} | 0 ...nd_analysis_uuid_of_duplications_index.rb} | 0 ...dex_rows_without_component_or_analysis.rb} | 0 ...is_uuid_not_null_on_duplications_index.rb} | 0 ...add_index_on_analysis_uuid_of_measures.rb} | 1 + ...267_populate_analysis_uuid_on_measures.rb} | 0 ...clean_measures_with_null_analysis_uuid.rb} | 0 ...drop_index_of_analysis_uuid_on_measures.rb | 31 ++++++++++++++ ...ake_analysis_uuid_not_null_on_measures.rb} | 0 ...gain_index_on_analysis_uuid_of_measures.rb | 29 ++++++++++++++ ...ots.rb => 1272_drop_trees_of_snapshots.rb} | 0 ...p_indices_on_tree_columns_of_snapshots.rb} | 0 ... 1274_drop_tree_columns_from_snapshots.rb} | 0 ..._drop_index_on_snapshot_id_of_measures.rb} | 0 ..._drop_snapshot_id_column_from_measures.rb} | 0 ...s.rb => 1277_add_b_columns_to_projects.rb} | 0 .../org/sonar/db/version/DatabaseVersion.java | 2 +- .../org/sonar/db/version/rows-h2.sql | 1 + 47 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1210_create_temporary_indices_for_1211.rb rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1210_clean_orphan_rows_in_snapshots.rb => 1211_clean_orphan_rows_in_snapshots.rb} (100%) create mode 100644 server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1212_drop_temporary_indices_of_1210.rb rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1211_make_component_uuid_columns_not_null_on_snapshots.rb => 1213_make_component_uuid_columns_not_null_on_snapshots.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1212_drop_snapshot_project_id_from_snapshots.rb => 1214_drop_snapshot_project_id_from_snapshots.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1213_drop_id_columns_from_snapshots.rb => 1215_drop_id_columns_from_snapshots.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1214_add_component_uuid_to_measures.rb => 1216_add_component_uuid_to_measures.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1215_populate_component_uuid_of_measures.rb => 1217_populate_component_uuid_of_measures.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1216_delete_orphan_measures_without_component.rb => 1218_delete_orphan_measures_without_component.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1217_make_component_uuid_not_null_on_measures.rb => 1219_make_component_uuid_not_null_on_measures.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1218_drop_project_id_column_from_measures.rb => 1220_drop_project_id_column_from_measures.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1219_add_index_on_component_uuid_of_measures.rb => 1221_add_index_on_component_uuid_of_measures.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1220_drop_remember_me_columns_from_users.rb => 1222_drop_remember_me_columns_from_users.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1221_clean_some_data_in_table_projects.rb => 1223_clean_some_data_in_table_projects.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1222_add_uuid_columns_to_projects.rb => 1224_add_uuid_columns_to_projects.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1223_populate_uuid_columns_of_projects.rb => 1225_populate_uuid_columns_of_projects.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1224_clean_orphan_rows_in_projects.rb => 1226_clean_orphan_rows_in_projects.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1225_drop_index_projects_uuid_from_projects.rb => 1227_drop_index_projects_uuid_from_projects.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1226_make_uuid_columns_not_null_on_projects.rb => 1228_make_uuid_columns_not_null_on_projects.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1227_recreate_index_projects_uuid_from_projects.rb => 1229_recreate_index_projects_uuid_from_projects.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1228_drop_index_projects_root_id_from_projects.rb => 1230_drop_index_projects_root_id_from_projects.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1229_drop_id_columns_from_projects.rb => 1231_drop_id_columns_from_projects.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1230_add_uuid_column_to_snapshots.rb => 1232_add_uuid_column_to_snapshots.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1231_populate_uuid_column_on_snapshots.rb => 1233_populate_uuid_column_on_snapshots.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1232_make_uuid_column_not_null_on_snapshots.rb => 1234_make_uuid_column_not_null_on_snapshots.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1233_add_unique_index_on_uuid_of_snapshots.rb => 1235_add_unique_index_on_uuid_of_snapshots.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1234_add_analysis_uuid_column_to_ce_activity.rb => 1236_add_analysis_uuid_column_to_ce_activity.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1235_populate_analysis_uuid_column_on_ce_activity.rb => 1237_populate_analysis_uuid_column_on_ce_activity.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1236_drop_snapshot_id_column_from_ce_activity.rb => 1238_drop_snapshot_id_column_from_ce_activity.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1237_add_component_uuid_and_analysis_uuid_to_duplications_index.rb => 1239_add_component_uuid_and_analysis_uuid_to_duplications_index.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1238_populate_component_uuid_and_analysis_uuid_of_duplications_index.rb => 1240_populate_component_uuid_and_analysis_uuid_of_duplications_index.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1239_delete_orphan_duplications_index_rows_without_component_or_analysis.rb => 1241_delete_orphan_duplications_index_rows_without_component_or_analysis.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1240_make_component_uuid_and_analysis_uuid_not_null_on_duplications_index.rb => 1242_make_component_uuid_and_analysis_uuid_not_null_on_duplications_index.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1275_add_index_on_analysis_uuid_of_measures.rb => 1266_add_index_on_analysis_uuid_of_measures.rb} (93%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1266_populate_analysis_uuid_on_measures.rb => 1267_populate_analysis_uuid_on_measures.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1267_clean_measures_with_null_analysis_uuid.rb => 1268_clean_measures_with_null_analysis_uuid.rb} (100%) create mode 100644 server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1269_temporarily_drop_index_of_analysis_uuid_on_measures.rb rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1268_make_analysis_uuid_not_null_on_measures.rb => 1270_make_analysis_uuid_not_null_on_measures.rb} (100%) create mode 100644 server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1271_add_again_index_on_analysis_uuid_of_measures.rb rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1270_drop_trees_of_snapshots.rb => 1272_drop_trees_of_snapshots.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1271_drop_indices_on_tree_columns_of_snapshots.rb => 1273_drop_indices_on_tree_columns_of_snapshots.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1272_drop_tree_columns_from_snapshots.rb => 1274_drop_tree_columns_from_snapshots.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1273_drop_index_on_snapshot_id_of_measures.rb => 1275_drop_index_on_snapshot_id_of_measures.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1274_drop_snapshot_id_column_from_measures.rb => 1276_drop_snapshot_id_column_from_measures.rb} (100%) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1276_add_b_columns_to_projects.rb => 1277_add_b_columns_to_projects.rb} (100%) diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1210_create_temporary_indices_for_1211.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1210_create_temporary_indices_for_1211.rb new file mode 100644 index 00000000000..49cf234b3bd --- /dev/null +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1210_create_temporary_indices_for_1211.rb @@ -0,0 +1,30 @@ +# +# SonarQube, open source software quality management tool. +# Copyright (C) 2008-2014 SonarSource +# mailto:contact AT sonarsource DOT com +# +# SonarQube 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. +# +# SonarQube 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. +# + +# +# SonarQube 6.0 +# +class CreateTemporaryIndicesFor1211 < ActiveRecord::Migration + + def self.up + add_index :ce_activity, :snapshot_id, :name => 'ce_activity_snapshot_id' + add_index :duplications_index, :project_snapshot_id, :name => 'dup_index_psid' + end +end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1210_clean_orphan_rows_in_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1211_clean_orphan_rows_in_snapshots.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1210_clean_orphan_rows_in_snapshots.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1211_clean_orphan_rows_in_snapshots.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1212_drop_temporary_indices_of_1210.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1212_drop_temporary_indices_of_1210.rb new file mode 100644 index 00000000000..a711d441c28 --- /dev/null +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1212_drop_temporary_indices_of_1210.rb @@ -0,0 +1,40 @@ +# +# SonarQube, open source software quality management tool. +# Copyright (C) 2008-2014 SonarSource +# mailto:contact AT sonarsource DOT com +# +# SonarQube 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. +# +# SonarQube 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. +# + +# +# SonarQube 6.0 +# +class DropTemporaryIndicesOf1210 < ActiveRecord::Migration + + def self.up + drop_index_quietly :ce_activity, 'ce_activity_snapshot_id' + drop_index_quietly :duplications_index, 'dup_index_psid' + end + + private + + def self.drop_index_quietly(table, index) + begin + remove_index table, :name => index + rescue + #ignore + end + end +end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1211_make_component_uuid_columns_not_null_on_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1213_make_component_uuid_columns_not_null_on_snapshots.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1211_make_component_uuid_columns_not_null_on_snapshots.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1213_make_component_uuid_columns_not_null_on_snapshots.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1212_drop_snapshot_project_id_from_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1214_drop_snapshot_project_id_from_snapshots.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1212_drop_snapshot_project_id_from_snapshots.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1214_drop_snapshot_project_id_from_snapshots.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1213_drop_id_columns_from_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1215_drop_id_columns_from_snapshots.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1213_drop_id_columns_from_snapshots.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1215_drop_id_columns_from_snapshots.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1214_add_component_uuid_to_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1216_add_component_uuid_to_measures.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1214_add_component_uuid_to_measures.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1216_add_component_uuid_to_measures.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1215_populate_component_uuid_of_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1217_populate_component_uuid_of_measures.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1215_populate_component_uuid_of_measures.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1217_populate_component_uuid_of_measures.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1216_delete_orphan_measures_without_component.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1218_delete_orphan_measures_without_component.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1216_delete_orphan_measures_without_component.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1218_delete_orphan_measures_without_component.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1217_make_component_uuid_not_null_on_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1219_make_component_uuid_not_null_on_measures.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1217_make_component_uuid_not_null_on_measures.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1219_make_component_uuid_not_null_on_measures.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1218_drop_project_id_column_from_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1220_drop_project_id_column_from_measures.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1218_drop_project_id_column_from_measures.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1220_drop_project_id_column_from_measures.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1219_add_index_on_component_uuid_of_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1221_add_index_on_component_uuid_of_measures.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1219_add_index_on_component_uuid_of_measures.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1221_add_index_on_component_uuid_of_measures.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1220_drop_remember_me_columns_from_users.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1222_drop_remember_me_columns_from_users.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1220_drop_remember_me_columns_from_users.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1222_drop_remember_me_columns_from_users.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1221_clean_some_data_in_table_projects.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1223_clean_some_data_in_table_projects.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1221_clean_some_data_in_table_projects.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1223_clean_some_data_in_table_projects.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1222_add_uuid_columns_to_projects.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1224_add_uuid_columns_to_projects.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1222_add_uuid_columns_to_projects.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1224_add_uuid_columns_to_projects.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1223_populate_uuid_columns_of_projects.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1225_populate_uuid_columns_of_projects.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1223_populate_uuid_columns_of_projects.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1225_populate_uuid_columns_of_projects.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1224_clean_orphan_rows_in_projects.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1226_clean_orphan_rows_in_projects.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1224_clean_orphan_rows_in_projects.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1226_clean_orphan_rows_in_projects.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1225_drop_index_projects_uuid_from_projects.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1227_drop_index_projects_uuid_from_projects.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1225_drop_index_projects_uuid_from_projects.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1227_drop_index_projects_uuid_from_projects.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1226_make_uuid_columns_not_null_on_projects.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1228_make_uuid_columns_not_null_on_projects.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1226_make_uuid_columns_not_null_on_projects.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1228_make_uuid_columns_not_null_on_projects.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1227_recreate_index_projects_uuid_from_projects.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1229_recreate_index_projects_uuid_from_projects.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1227_recreate_index_projects_uuid_from_projects.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1229_recreate_index_projects_uuid_from_projects.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1228_drop_index_projects_root_id_from_projects.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1230_drop_index_projects_root_id_from_projects.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1228_drop_index_projects_root_id_from_projects.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1230_drop_index_projects_root_id_from_projects.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1229_drop_id_columns_from_projects.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1231_drop_id_columns_from_projects.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1229_drop_id_columns_from_projects.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1231_drop_id_columns_from_projects.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1230_add_uuid_column_to_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1232_add_uuid_column_to_snapshots.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1230_add_uuid_column_to_snapshots.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1232_add_uuid_column_to_snapshots.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1231_populate_uuid_column_on_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1233_populate_uuid_column_on_snapshots.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1231_populate_uuid_column_on_snapshots.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1233_populate_uuid_column_on_snapshots.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1232_make_uuid_column_not_null_on_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1234_make_uuid_column_not_null_on_snapshots.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1232_make_uuid_column_not_null_on_snapshots.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1234_make_uuid_column_not_null_on_snapshots.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1233_add_unique_index_on_uuid_of_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1235_add_unique_index_on_uuid_of_snapshots.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1233_add_unique_index_on_uuid_of_snapshots.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1235_add_unique_index_on_uuid_of_snapshots.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1234_add_analysis_uuid_column_to_ce_activity.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1236_add_analysis_uuid_column_to_ce_activity.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1234_add_analysis_uuid_column_to_ce_activity.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1236_add_analysis_uuid_column_to_ce_activity.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1235_populate_analysis_uuid_column_on_ce_activity.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1237_populate_analysis_uuid_column_on_ce_activity.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1235_populate_analysis_uuid_column_on_ce_activity.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1237_populate_analysis_uuid_column_on_ce_activity.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1236_drop_snapshot_id_column_from_ce_activity.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1238_drop_snapshot_id_column_from_ce_activity.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1236_drop_snapshot_id_column_from_ce_activity.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1238_drop_snapshot_id_column_from_ce_activity.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1237_add_component_uuid_and_analysis_uuid_to_duplications_index.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1239_add_component_uuid_and_analysis_uuid_to_duplications_index.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1237_add_component_uuid_and_analysis_uuid_to_duplications_index.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1239_add_component_uuid_and_analysis_uuid_to_duplications_index.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1238_populate_component_uuid_and_analysis_uuid_of_duplications_index.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1240_populate_component_uuid_and_analysis_uuid_of_duplications_index.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1238_populate_component_uuid_and_analysis_uuid_of_duplications_index.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1240_populate_component_uuid_and_analysis_uuid_of_duplications_index.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1239_delete_orphan_duplications_index_rows_without_component_or_analysis.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1241_delete_orphan_duplications_index_rows_without_component_or_analysis.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1239_delete_orphan_duplications_index_rows_without_component_or_analysis.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1241_delete_orphan_duplications_index_rows_without_component_or_analysis.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1240_make_component_uuid_and_analysis_uuid_not_null_on_duplications_index.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1242_make_component_uuid_and_analysis_uuid_not_null_on_duplications_index.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1240_make_component_uuid_and_analysis_uuid_not_null_on_duplications_index.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1242_make_component_uuid_and_analysis_uuid_not_null_on_duplications_index.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1275_add_index_on_analysis_uuid_of_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1266_add_index_on_analysis_uuid_of_measures.rb similarity index 93% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1275_add_index_on_analysis_uuid_of_measures.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1266_add_index_on_analysis_uuid_of_measures.rb index f2ad93b0193..32ca43685f9 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1275_add_index_on_analysis_uuid_of_measures.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1266_add_index_on_analysis_uuid_of_measures.rb @@ -24,6 +24,7 @@ class AddIndexOnAnalysisUuidOfMeasures < ActiveRecord::Migration def self.up + # this index must be present for the performance of next migration add_index :project_measures, [:analysis_uuid, :metric_id], :name => 'measures_analysis_metric' end end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1266_populate_analysis_uuid_on_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1267_populate_analysis_uuid_on_measures.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1266_populate_analysis_uuid_on_measures.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1267_populate_analysis_uuid_on_measures.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1267_clean_measures_with_null_analysis_uuid.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1268_clean_measures_with_null_analysis_uuid.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1267_clean_measures_with_null_analysis_uuid.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1268_clean_measures_with_null_analysis_uuid.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1269_temporarily_drop_index_of_analysis_uuid_on_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1269_temporarily_drop_index_of_analysis_uuid_on_measures.rb new file mode 100644 index 00000000000..42d47590c1f --- /dev/null +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1269_temporarily_drop_index_of_analysis_uuid_on_measures.rb @@ -0,0 +1,31 @@ +# +# SonarQube, open source software quality management tool. +# Copyright (C) 2008-2014 SonarSource +# mailto:contact AT sonarsource DOT com +# +# SonarQube 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. +# +# SonarQube 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. +# + +# +# SonarQube 6.0 +# +class TemporarilyDropIndexOfAnalysisUuidOnMeasures < ActiveRecord::Migration + + def self.up + # the index must be dropped for the compatibility of migration 1270 + # with MSSQL + remove_index :project_measures, :name => 'measures_analysis_metric' + end +end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1268_make_analysis_uuid_not_null_on_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1270_make_analysis_uuid_not_null_on_measures.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1268_make_analysis_uuid_not_null_on_measures.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1270_make_analysis_uuid_not_null_on_measures.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1271_add_again_index_on_analysis_uuid_of_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1271_add_again_index_on_analysis_uuid_of_measures.rb new file mode 100644 index 00000000000..858bf8e7b2c --- /dev/null +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1271_add_again_index_on_analysis_uuid_of_measures.rb @@ -0,0 +1,29 @@ +# +# SonarQube, open source software quality management tool. +# Copyright (C) 2008-2014 SonarSource +# mailto:contact AT sonarsource DOT com +# +# SonarQube 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. +# +# SonarQube 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. +# + +# +# SonarQube 6.0 +# +class AddAgainIndexOnAnalysisUuidOfMeasures < ActiveRecord::Migration + + def self.up + add_index :project_measures, [:analysis_uuid, :metric_id], :name => 'measures_analysis_metric' + end +end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1270_drop_trees_of_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1272_drop_trees_of_snapshots.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1270_drop_trees_of_snapshots.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1272_drop_trees_of_snapshots.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1271_drop_indices_on_tree_columns_of_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1273_drop_indices_on_tree_columns_of_snapshots.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1271_drop_indices_on_tree_columns_of_snapshots.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1273_drop_indices_on_tree_columns_of_snapshots.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1272_drop_tree_columns_from_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1274_drop_tree_columns_from_snapshots.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1272_drop_tree_columns_from_snapshots.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1274_drop_tree_columns_from_snapshots.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1273_drop_index_on_snapshot_id_of_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1275_drop_index_on_snapshot_id_of_measures.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1273_drop_index_on_snapshot_id_of_measures.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1275_drop_index_on_snapshot_id_of_measures.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1274_drop_snapshot_id_column_from_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1276_drop_snapshot_id_column_from_measures.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1274_drop_snapshot_id_column_from_measures.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1276_drop_snapshot_id_column_from_measures.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1276_add_b_columns_to_projects.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1277_add_b_columns_to_projects.rb similarity index 100% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1276_add_b_columns_to_projects.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1277_add_b_columns_to_projects.rb diff --git a/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java b/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java index 796c16e5954..e8b30543628 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java +++ b/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java @@ -30,7 +30,7 @@ import org.sonar.db.MyBatis; public class DatabaseVersion { - public static final int LAST_VERSION = 1_276; + public static final int LAST_VERSION = 1_277; /** * The minimum supported version which can be upgraded. Lower diff --git a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql index fff413c49dd..ea257a66f8b 100644 --- a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql +++ b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql @@ -484,6 +484,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1273'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1274'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1275'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1276'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1277'); INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, EXTERNAL_IDENTITY, EXTERNAL_IDENTITY_PROVIDER, USER_LOCAL, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT) VALUES (1, 'admin', 'Administrator', '', 'admin', 'sonarqube', true, 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '1418215735482', '1418215735482'); ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2; -- 2.39.5