aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2010-11-30 21:38:13 +0000
committersimonbrandhof <simon.brandhof@gmail.com>2010-11-30 21:38:13 +0000
commitcfde89d0b0a2015e9ff6f91ab5992f8b9dd82f48 (patch)
treee902e71ec1017b11a16f8fb040849287069c2683 /sonar-server
parent287406ffe55756cae804670d1b422dd124a61d60 (diff)
downloadsonarqube-cfde89d0b0a2015e9ff6f91ab5992f8b9dd82f48.tar.gz
sonarqube-cfde89d0b0a2015e9ff6f91ab5992f8b9dd82f48.zip
database migration : remove/update some scripts that are used only in releases <= 1.8
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/001_initial_schema.rb11
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/002_index_database.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/009_add_project_measures_subkey.rb27
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/011_create_properties_table.rb29
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/013_add_metrics_names.rb8
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/017_add_files_file_type_column.rb26
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/035_projects_to_entities.rb14
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/045_update_properties_columns.rb44
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/046_simplify_metrics.rb6
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/059_add_properties_resource.rb20
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/069_add_diff_columns_to_measures.rb6
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/070_update_default_coverage_plugin.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/072_delete_snapshots_purged.rb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/076_upgrade_properties_to_blobs.rb3
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/078_increase_project_kee_size.rb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/079_create_groups.rb3
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/080_create_groups_users.rb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/081_add_projects_long_name.rb3
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/082_include_branch_in_project_name.rb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/083_add_index_to_measures_value.rb3
20 files changed, 1 insertions, 222 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/001_initial_schema.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/001_initial_schema.rb
index 02467a5d33f..bd37c1644ff 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/001_initial_schema.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/001_initial_schema.rb
@@ -20,9 +20,6 @@
class InitialSchema < ActiveRecord::Migration
def self.up
create_table :projects do |t|
- t.column :group_id, :string, :null => false, :limit => 256
- t.column :artifact_id, :string, :null => false, :limit => 256
- t.column :branch, :string, :null => false, :limit => 64
t.column :name, :string, :null => true, :limit => 256
t.column :description, :string, :null => true, :limit => 2000
t.column :enabled, :boolean, :null => false, :default => true
@@ -54,13 +51,6 @@ class InitialSchema < ActiveRecord::Migration
t.column :rules_category_id, :integer
end
- create_table :files do |t|
- t.column :snapshot_id, :integer, :null => false
- t.column :filename, :string, :limit => 255
- t.column :namespace, :string, :limit => 500
- t.column :path, :string, :limit => 500
- end
-
create_table :rules_categories do |t|
t.column :name, :string, :null => false, :limit => 255
t.column :description, :string, :null => false, :limit => 1000
@@ -85,7 +75,6 @@ class InitialSchema < ActiveRecord::Migration
t.column :snapshot_id, :integer, :null => false
t.column :rule_id, :integer, :null => false
t.column :failure_level, :integer, :null => false
- t.column :file_id, :integer
t.column :message, :string, :limit => 500
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/002_index_database.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/002_index_database.rb
index 4bf2e2641a3..5e1797d5397 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/002_index_database.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/002_index_database.rb
@@ -20,8 +20,6 @@
class IndexDatabase < ActiveRecord::Migration
def self.up
- add_index :files, :snapshot_id, :name => 'file_snapshot_id'
-
add_index :project_measures, :snapshot_id, :name => 'project_measure_snapshot_id'
add_index :rule_failures, :snapshot_id, :name => 'rule_failure_snapshot_id'
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/009_add_project_measures_subkey.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/009_add_project_measures_subkey.rb
deleted file mode 100644
index 5b7672e91a3..00000000000
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/009_add_project_measures_subkey.rb
+++ /dev/null
@@ -1,27 +0,0 @@
- #
- # Sonar, entreprise quality control tool.
- # Copyright (C) 2009 SonarSource SA
- # mailto:contact AT sonarsource DOT com
- #
- # Sonar 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.
- #
- # Sonar 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 Sonar; if not, write to the Free Software
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- #
-class AddProjectMeasuresSubkey < ActiveRecord::Migration
-
- def self.up
- add_column(:project_measures, :subkey, :string, {:limit => 10, :nullable => true})
- ProjectMeasure.reset_column_information
- end
-
-end \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/011_create_properties_table.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/011_create_properties_table.rb
deleted file mode 100644
index c7dd4ceedc5..00000000000
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/011_create_properties_table.rb
+++ /dev/null
@@ -1,29 +0,0 @@
- #
- # Sonar, entreprise quality control tool.
- # Copyright (C) 2009 SonarSource SA
- # mailto:contact AT sonarsource DOT com
- #
- # Sonar 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.
- #
- # Sonar 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 Sonar; if not, write to the Free Software
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- #
-class CreatePropertiesTable < ActiveRecord::Migration
-
- def self.up
- create_table 'properties', :id => false do |t|
- t.column :prop_key, :string, :limit => 512
- t.column :prop_value, :string, :limit => 4000
- end
- end
-
-end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/013_add_metrics_names.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/013_add_metrics_names.rb
index 7cb83ebb453..ac7b9150e82 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/013_add_metrics_names.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/013_add_metrics_names.rb
@@ -22,15 +22,7 @@ class AddMetricsNames < ActiveRecord::Migration
def self.up
add_column(:metrics, :domain, :string, :null => true, :limit => 64)
add_column(:metrics, :short_name, :string, :null => true, :limit => 64)
- add_column(:metrics, :long_name, :string, :null => true, :limit => 64)
add_column(:metrics, :qualitative, :boolean, :null => false, :default => false)
- Metric013.reset_column_information
-
end
- private
-
- class Metric013 < ActiveRecord::Base
- set_table_name "metrics"
- end
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/017_add_files_file_type_column.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/017_add_files_file_type_column.rb
deleted file mode 100644
index c993d3ded97..00000000000
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/017_add_files_file_type_column.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2009 SonarSource SA
-# mailto:contact AT sonarsource DOT com
-#
-# Sonar 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.
-#
-# Sonar 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 Sonar; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
-#
-class AddFilesFileTypeColumn < ActiveRecord::Migration
-
- def self.up
- add_column(:files, :file_type, :string, :nullable => false, :limit => 32, :default => 'MAIN')
- end
-
-end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/035_projects_to_entities.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/035_projects_to_entities.rb
index d213a1387e3..e69193ba949 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/035_projects_to_entities.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/035_projects_to_entities.rb
@@ -33,9 +33,6 @@ class ProjectsToEntities < ActiveRecord::Migration
add_column 'projects', 'kee', :string, :limit => 230
add_column 'projects', 'root_id', :integer
- remove_column 'projects', 'group_id'
- remove_column 'projects', 'artifact_id'
- remove_column 'projects', 'branch'
Project.reset_column_information
upgrade_snapshots
@@ -47,7 +44,6 @@ class ProjectsToEntities < ActiveRecord::Migration
private
def self.migrate_distribution_data
- remove_column :project_measures, :subkey
add_column :project_measures, :text_value, :string, :limit => 96, :null => true
ProjectMeasure.reset_column_information
end
@@ -77,16 +73,6 @@ class ProjectsToEntities < ActiveRecord::Migration
t.column :data, :text
end
add_index :snapshot_sources, :snapshot_id, :name => 'snap_sources_snapshot_id'
-
- drop_table 'files'
-
- begin
- remove_index :rule_failures, :name => 'rule_failure_file_id'
- rescue
- end
-
- remove_column 'rule_failures', 'file_id'
- RuleFailure.reset_column_information
end
class RuleFailure035 < ActiveRecord::Base
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/045_update_properties_columns.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/045_update_properties_columns.rb
deleted file mode 100644
index 9d2a1a88358..00000000000
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/045_update_properties_columns.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2009 SonarSource SA
-# mailto:contact AT sonarsource DOT com
-#
-# Sonar 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.
-#
-# Sonar 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 Sonar; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
-#
-class UpdatePropertiesColumns < ActiveRecord::Migration
-
- def self.up
- p=Property045.find(:first, :conditions => {:prop_key => 'tendency.depth'})
- previous_tendency_value=(p ? p.prop_value : nil)
-
- remove_column :properties, :prop_value
- add_column :properties, :prop_value, :text, :null => true
- Property045.reset_column_information
-
- tendency=Property045.find(:first, :conditions => {:prop_key => 'tendency.depth'})
- if tendency && previous_tendency_value
- tendency.prop_value=previous_tendency_value
- tendency.save!
- end
-
- Property.reset_column_information
- end
-
-end
-
-class Property045 < ActiveRecord::Base
- set_table_name 'properties'
- self.primary_key = 'prop_key'
-end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/046_simplify_metrics.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/046_simplify_metrics.rb
index 19e9a5d41fd..08c56f4b5b3 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/046_simplify_metrics.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/046_simplify_metrics.rb
@@ -25,15 +25,9 @@ class SimplifyMetrics < ActiveRecord::Migration
add_column(:metrics, :val_type, :string, :null => true, :limit => 8)
add_column(:metrics, :user_managed, :boolean, :null => true, :default => false)
add_column(:metrics, :enabled, :boolean, :null => true, :default => true)
- remove_column(:metrics, :long_name)
- Metric046.reset_column_information
remove_column(:metrics, :value_type)
Metric.reset_column_information
end
-
- class Metric046 < ActiveRecord::Base
- set_table_name "metrics"
- end
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/059_add_properties_resource.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/059_add_properties_resource.rb
index e0acba2f83b..8d371c5aaf3 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/059_add_properties_resource.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/059_add_properties_resource.rb
@@ -20,32 +20,12 @@
class AddPropertiesResource < ActiveRecord::Migration
def self.up
- properties=Property059.find(:all)
-
- drop_table 'properties'
-
create_table 'properties' do |t|
t.column :prop_key, :string, :limit => 512
t.column :resource_id, :integer, :null => true
t.column :prop_value, :string, :limit => 4000
end
add_index :properties, :prop_key, :name => 'properties_key'
-
- Property.reset_column_information
-
- properties.each do |p|
- Property.create(:prop_key => p.prop_key, :prop_value => p.prop_value)
- end
-
end
- def self.down
-
- end
-
-
- class Property059 < ActiveRecord::Base
- set_table_name 'properties'
- self.primary_key = 'prop_key'
- end
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/069_add_diff_columns_to_measures.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/069_add_diff_columns_to_measures.rb
index 0fa005d2d20..5be2c8cbeef 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/069_add_diff_columns_to_measures.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/069_add_diff_columns_to_measures.rb
@@ -25,10 +25,4 @@ class AddDiffColumnsToMeasures < ActiveRecord::Migration
add_column(:project_measures, :diff_value_3, :decimal, :null => true, :precision => 30, :scale => 20)
end
- def self.down
- remove_column(:project_measures, :diff_value_1)
- remove_column(:project_measures, :diff_value_2)
- remove_column(:project_measures, :diff_value_3)
- end
-
end \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/070_update_default_coverage_plugin.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/070_update_default_coverage_plugin.rb
index e11c9607301..d223032fe7c 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/070_update_default_coverage_plugin.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/070_update_default_coverage_plugin.rb
@@ -21,7 +21,7 @@ class UpdateDefaultCoveragePlugin < ActiveRecord::Migration
def self.up
property=Property070.find(:first, :conditions => ['prop_key=?','sonar.core.codeCoveragePlugin'])
- if property and property.prop_value=='clover,cobertura'
+ if property && property.prop_value=='clover,cobertura'
property.prop_value='cobertura'
property.save!
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/072_delete_snapshots_purged.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/072_delete_snapshots_purged.rb
index f6cde507859..1f251153a79 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/072_delete_snapshots_purged.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/072_delete_snapshots_purged.rb
@@ -23,8 +23,4 @@ class DeleteSnapshotsPurged < ActiveRecord::Migration
remove_column(:snapshots, :purged)
Snapshot.reset_column_information
end
-
- def self.down
-
- end
end \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/076_upgrade_properties_to_blobs.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/076_upgrade_properties_to_blobs.rb
index 75371e90181..e6f88cff2b6 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/076_upgrade_properties_to_blobs.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/076_upgrade_properties_to_blobs.rb
@@ -32,7 +32,4 @@ class UpgradePropertiesToBlobs < ActiveRecord::Migration
Property.reset_column_information
end
- def self.down
-
- end
end \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/078_increase_project_kee_size.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/078_increase_project_kee_size.rb
index d7a56699681..7fa685c6c7b 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/078_increase_project_kee_size.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/078_increase_project_kee_size.rb
@@ -22,9 +22,5 @@ class IncreaseProjectKeeSize < ActiveRecord::Migration
def self.up
change_column('projects', 'kee', :string, :limit => 400)
end
-
- def self.down
-
- end
end \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/079_create_groups.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/079_create_groups.rb
index 3d59a604d5f..2e092e73b0f 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/079_create_groups.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/079_create_groups.rb
@@ -27,7 +27,4 @@ class CreateGroups < ActiveRecord::Migration
end
end
- def self.down
- drop_table :groups
- end
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/080_create_groups_users.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/080_create_groups_users.rb
index 43b95f84b1a..d9e634a8947 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/080_create_groups_users.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/080_create_groups_users.rb
@@ -26,8 +26,4 @@ class CreateGroupsUsers < ActiveRecord::Migration
add_index "groups_users", "user_id"
add_index "groups_users", "group_id"
end
-
- def self.down
- drop_table :groups_users
- end
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/081_add_projects_long_name.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/081_add_projects_long_name.rb
index be45489b122..cc0e3b23e64 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/081_add_projects_long_name.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/081_add_projects_long_name.rb
@@ -24,7 +24,4 @@ class AddProjectsLongName < ActiveRecord::Migration
Project.reset_column_information
end
- def self.down
- remove_column :projects, :long_name
- end
end \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/082_include_branch_in_project_name.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/082_include_branch_in_project_name.rb
index e44ab830da0..22b84581557 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/082_include_branch_in_project_name.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/082_include_branch_in_project_name.rb
@@ -29,10 +29,6 @@ class IncludeBranchInProjectName < ActiveRecord::Migration
end
end
- def self.down
-
- end
-
private
def self.branch(project)
s=project.kee.split(':')
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/083_add_index_to_measures_value.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/083_add_index_to_measures_value.rb
index 1f65b2383f7..203f7be4b93 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/083_add_index_to_measures_value.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/083_add_index_to_measures_value.rb
@@ -24,7 +24,4 @@ class AddIndexToMeasuresValue < ActiveRecord::Migration
# See SONAR-1190 Make faster drilldown pages
end
- def self.down
-
- end
end \ No newline at end of file