]> source.dussan.org Git - sonarqube.git/commitdiff
Remove upgrades from version <= 2.2
authorSimon Brandhof <simon.brandhof@gmail.com>
Mon, 3 Dec 2012 17:34:30 +0000 (18:34 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Tue, 4 Dec 2012 12:18:19 +0000 (13:18 +0100)
12 files changed:
sonar-server/src/main/webapp/WEB-INF/db/migrate/002_index_database.rb
sonar-server/src/main/webapp/WEB-INF/db/migrate/053_create_events_table.rb
sonar-server/src/main/webapp/WEB-INF/db/migrate/059_create_properties.rb
sonar-server/src/main/webapp/WEB-INF/db/migrate/089_set_default_project_roles.rb [deleted file]
sonar-server/src/main/webapp/WEB-INF/db/migrate/101_remove_null_snapshot_created_at.rb [deleted file]
sonar-server/src/main/webapp/WEB-INF/db/migrate/110_add_events_data.rb [deleted file]
sonar-server/src/main/webapp/WEB-INF/db/migrate/112_delete_checkstyle_jee_rules.rb [deleted file]
sonar-server/src/main/webapp/WEB-INF/db/migrate/113_rename_clover_properties.rb [deleted file]
sonar-server/src/main/webapp/WEB-INF/db/migrate/114_add_user_properties.rb [deleted file]
sonar-server/src/main/webapp/WEB-INF/db/migrate/115_create_filters.rb
sonar-server/src/main/webapp/WEB-INF/db/migrate/116_set_resource_long_names.rb [deleted file]
sonar-server/src/main/webapp/WEB-INF/db/migrate/117_remove_measure_sid_index.rb [deleted file]

index 3c5cf072e35219df214e4b02442487f003d144f1..bebf7ab35124f85f137a6346c06b565e0f2916db 100644 (file)
@@ -20,8 +20,6 @@
 class IndexDatabase < ActiveRecord::Migration
   
   def self.up
-    add_index :project_measures, :snapshot_id, :name => 'project_measure_snapshot_id'
-    
     add_index :rule_failures, :snapshot_id, :name => 'rule_failure_snapshot_id'
     add_index :rule_failures, :rule_id, :name => 'rule_failure_rule_id'
     add_index :rules_parameters, :rule_id, :name => 'rules_parameters_rule_id'
index 11e876dca4b6b68b492058f5da063fd906a165c9..26a05bdf0d2a7ae0e3a99399233fae3be40a4b4e 100644 (file)
@@ -28,6 +28,7 @@ class CreateEventsTable < ActiveRecord::Migration
       t.column :event_date, :datetime,  :null => true
       t.column :created_at, :datetime,  :null => true
       t.column :description, :string,  :limit => 3072, :null => true
+      t.column :data, :string, :null => true, :limit => 4000
     end
     add_index :events, :resource_id, :name => 'events_resource_id'
     add_index :events, :snapshot_id, :name => 'events_snapshot_id'
index a1a1f37e55428b3138599f1beac97eaaab95c86e..d35ad09077d3a4aadca4d983cc4c9b503997625f 100644 (file)
@@ -24,6 +24,7 @@ class CreateProperties < ActiveRecord::Migration
       t.column :prop_key,   :string, :limit => 512
       t.column :resource_id, :integer, :null => true
            t.column :text_value, :text, :null => true
+      t.column :user_id, :integer, :null => true
     end
     add_index :properties, :prop_key, :name => 'properties_key'
   end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/089_set_default_project_roles.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/089_set_default_project_roles.rb
deleted file mode 100644 (file)
index 4dbc9ec..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2012 SonarSource
-# 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
-#
-# sonar 2.0
-class SetDefaultProjectRoles < ActiveRecord::Migration
-
-  def self.up
-  end
-
-end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/101_remove_null_snapshot_created_at.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/101_remove_null_snapshot_created_at.rb
deleted file mode 100644 (file)
index ce91a9a..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2012 SonarSource
-# 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
-#
-# sonar 2.1.2
-class RemoveNullSnapshotCreatedAt < ActiveRecord::Migration
-
-  class Snapshot < ActiveRecord::Base
-  end
-
-  def self.up
-    Snapshot.reset_column_information
-    Snapshot.find(:all, :conditions => ["scope=? and created_at IS NULL and status=?", 'PRJ', 'P']).each do |s|
-      s.created_at = Time.now
-      s.save
-    end
-  end
-end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/110_add_events_data.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/110_add_events_data.rb
deleted file mode 100644 (file)
index cddca29..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2012 SonarSource
-# 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
-#
-
-#
-# Sonar 2.2
-#
-class AddEventsData < ActiveRecord::Migration
-
-  def self.up
-    add_column 'events', 'data', :string, :null => true, :limit => 4000
-  end
-
-end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/112_delete_checkstyle_jee_rules.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/112_delete_checkstyle_jee_rules.rb
deleted file mode 100644 (file)
index 326cbd5..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
- #
- # Sonar, entreprise quality control tool.
- # Copyright (C) 2008-2012 SonarSource
- # 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
- #
-
-#
-# Sonar 2.2
-#
-class DeleteCheckstyleJeeRules < ActiveRecord::Migration
-
-  class Rule < ActiveRecord::Base
-  end
-
-  class ActiveRule < ActiveRecord::Base
-  end
-
-  def self.up
-    Rule.reset_column_information
-    ActiveRule.reset_column_information
-
-    delete_rule('com.puppycrawl.tools.checkstyle.checks.j2ee.EntityBeanCheck')
-    delete_rule('com.puppycrawl.tools.checkstyle.checks.j2ee.FinalStaticCheck')
-    delete_rule('com.puppycrawl.tools.checkstyle.checks.j2ee.LocalHomeInterfaceCheck')
-    delete_rule('com.puppycrawl.tools.checkstyle.checks.j2ee.LocalInterfaceCheck')
-    delete_rule('com.puppycrawl.tools.checkstyle.checks.j2ee.MessageBeanCheck')
-    delete_rule('com.puppycrawl.tools.checkstyle.checks.j2ee.RemoteHomeInterfaceCheck')
-    delete_rule('com.puppycrawl.tools.checkstyle.checks.j2ee.RemoteInterfaceCheck')
-    delete_rule('com.puppycrawl.tools.checkstyle.checks.j2ee.SessionBeanCheck')
-    delete_rule('com.puppycrawl.tools.checkstyle.checks.j2ee.ThisParameterCheck')
-    delete_rule('com.puppycrawl.tools.checkstyle.checks.j2ee.ThisReturnCheck')
-    delete_rule('com.puppycrawl.tools.checkstyle.checks.whitespace.TabCharacterCheck')
-    delete_rule('com.puppycrawl.tools.checkstyle.checks.RequiredRegexpCheck')
-    delete_rule('com.puppycrawl.tools.checkstyle.checks.javadoc.PackageHtmlCheck')
-  end
-
-  def self.down
-
-  end
-
-  private
-  def self.delete_rule(rule_key)
-    rule=Rule.find(:first, :conditions => {:plugin_name => 'checkstyle', :plugin_rule_key => rule_key})
-    if rule
-      say_with_time "Deleting Checkstyle rule #{rule_key}..." do
-        rule_id=rule.id
-        ActiveRule.destroy_all(["rule_id=?", rule_id])
-        rule.destroy
-      end
-    end
-  end
-end
\ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/113_rename_clover_properties.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/113_rename_clover_properties.rb
deleted file mode 100644 (file)
index bc86dfa..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2012 SonarSource
-# 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
-#
-
-#
-# Sonar 2.2
-#
-class RenameCloverProperties < ActiveRecord::Migration
-
-  class Property < ActiveRecord::Base
-  end
-
-  def self.up
-    Property.reset_column_information
-    property=Property.find_by_prop_key('sonar.clover.licenseV2.secured')
-    if property
-      Property.create(:prop_key => 'sonar.clover.license.secured', :text_value => property.text_value)
-      property.delete
-    end
-  end
-
-end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/114_add_user_properties.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/114_add_user_properties.rb
deleted file mode 100644 (file)
index 5485895..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2012 SonarSource
-# 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
-#
-
-#
-# Sonar 2.2
-#
-class AddUserProperties < ActiveRecord::Migration
-
-  def self.up
-    add_column 'properties', 'user_id', :integer, :null => true
-  end
-end
index afe9a2b7f50c76ff50cb482501d6663ce781ac95..841bea28ac1b7f14d870d944df198d1d69422e10 100644 (file)
 #
 class CreateFilters < ActiveRecord::Migration
 
-  class Property < ActiveRecord::Base
-  end
-
-  class ActiveFilter < ActiveRecord::Base
-    belongs_to :filter
-  end
-
   def self.up
     create_table 'filters' do |t|
       t.column 'name', :string, :limit => 100
@@ -65,102 +58,6 @@ class CreateFilters < ActiveRecord::Migration
       t.column 'order_index', :integer, :null => true
     end
 
-    add_default_filters()
-  end
-
-  private
-
-  def self.add_default_filters
-    ActiveFilter.reset_column_information
-    Filter.reset_column_information
-
-    projects_filter=create_projects_filter()
-    ActiveFilter.create(:filter => projects_filter, :user_id => nil, :order_index => 1)
-
-    treemap_filter=create_treemap_filter()
-    if treemap_filter
-      ActiveFilter.create(:filter => treemap_filter, :user_id => nil, :order_index => 2)
-    end
-
-    favourites_filter=create_favourites_filter
-    ActiveFilter.create(:filter => favourites_filter, :user_id => nil, :order_index => (treemap_filter ? 3 : 2))
   end
 
-  def self.create_projects_filter
-    projects_filter=::Filter.new(:name => 'Projects', :kee => 'Projects', :shared => true, :favourites => false, :default_view => ::Filter::VIEW_LIST)
-    projects_filter.criteria<<Criterion.new_for_qualifiers([Project::QUALIFIER_PROJECT])
-    projects_filter.columns.build(:family => 'metric', :kee => 'alert_status', :order_index => 1)
-    projects_filter.columns.build(:family => 'name', :order_index => 2, :sort_direction => 'ASC')
-
-    prop=property_value('sonar.core.projectsdashboard.columns')
-    if prop
-      index=3
-      prop.split(";").each do |col|
-        fields=col.split('.')
-        if fields[0]=='METRIC'
-          projects_filter.columns.build(:family => 'metric', :kee => fields[1], :order_index => index)
-          index+=1
-        elsif fields[0]=='BUILD_TIME'
-          projects_filter.columns.build(:family => 'date', :order_index => index)
-          index+=1
-        elsif fields[0]=='LINKS'
-          projects_filter.columns.build(:family => 'links', :order_index => index)
-          index+=1
-        elsif fields[0]=='LANGUAGE'
-          projects_filter.columns.build(:family => 'language', :order_index => index)
-          index+=1
-        elsif fields[0]=='VERSION'
-          projects_filter.columns.build(:family => 'version', :order_index => index)
-          index+=1
-        end
-      end
-    else
-      projects_filter.columns.build(:family => 'version', :order_index => 3)
-      projects_filter.columns.build(:family => 'metric', :kee => 'ncloc', :order_index => 4)
-      projects_filter.columns.build(:family => 'metric', :kee => 'violations_density', :order_index => 5)
-      projects_filter.columns.build(:family => 'date', :order_index => 6)
-      projects_filter.columns.build(:family => 'links', :order_index => 7)
-    end
-    projects_filter.save
-    projects_filter
-  end
-
-  def self.create_treemap_filter
-    show_treemap=property_value('sonar.core.projectsdashboard.showTreemap', 'true')
-    if show_treemap=='true'
-      size_metric=property_value('sonar.core.treemap.sizemetric', 'ncloc')
-      color_metric=property_value('sonar.core.treemap.colormetric', 'violations_density')
-
-      treemap_filter=::Filter.new(:name => 'Treemap', :kee => 'Treemap', :shared => true, :favourites => false, :default_view => ::Filter::VIEW_TREEMAP)
-      treemap_filter.criteria<<Criterion.new_for_qualifiers([Project::QUALIFIER_PROJECT])
-      treemap_filter.columns.build(:family => 'name', :order_index => 1)
-      treemap_filter.columns.build(:family => 'metric', :kee => size_metric, :order_index => 2)
-      treemap_filter.columns.build(:family => 'metric', :kee => color_metric, :order_index => 3)
-      treemap_filter.save
-      treemap_filter
-    else
-      nil
-    end
-  end
-
-  def self.create_favourites_filter
-    favourites_filter=::Filter.new(:name => 'My favourites', :kee => 'My favourites', :shared => true, :favourites => true, :default_view => ::Filter::VIEW_LIST)
-    favourites_filter.criteria<<Criterion.new_for_qualifiers(Project::QUALIFIERS)
-    favourites_filter.columns.build(:family => 'metric', :kee => 'alert_status', :order_index => 1)
-    favourites_filter.columns.build(:family => 'name', :order_index => 2, :sort_direction => 'ASC')
-    favourites_filter.columns.build(:family => 'metric', :kee => 'ncloc', :order_index => 3)
-    favourites_filter.columns.build(:family => 'metric', :kee => 'violations_density', :order_index => 4)
-    favourites_filter.columns.build(:family => 'date', :order_index => 5)
-    favourites_filter.save
-    favourites_filter
-  end
-
-  def self.property_value(key, default_value=nil)
-    prop = Property.find(:first, :conditions => {'prop_key' => key, 'resource_id' => nil, 'user_id' => nil})
-    if prop
-      prop.text_value || default_value
-    else
-      default_value
-    end
-  end
-end
+end
\ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/116_set_resource_long_names.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/116_set_resource_long_names.rb
deleted file mode 100644 (file)
index 938f399..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2012 SonarSource
-# 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
-#
-
-#
-# Sonar 2.2
-#
-class SetResourceLongNames < ActiveRecord::Migration
-
-  class Project < ActiveRecord::Base
-  end
-
-  def self.up
-    Project.reset_column_information
-    update('TRK')
-    update('BRC')
-    update('PAC')
-    update('DIR')
-    update('LIB')
-    update('CLA')
-    update('FIL')
-    update('UTS')
-    update('VW')
-    update('SVW')
-  end
-
-  private
-
-  def self.update(qualifier)
-    Project.connection.update("update projects set long_name=name where long_name is null and qualifier='#{qualifier}'")
-  end
-end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/117_remove_measure_sid_index.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/117_remove_measure_sid_index.rb
deleted file mode 100644 (file)
index ac184df..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2012 SonarSource
-# 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
-#
-
-#
-# Sonar 2.2
-#
-class RemoveMeasureSidIndex < ActiveRecord::Migration
-
-  def self.up
-    remove_index :project_measures, :name => 'project_measure_snapshot_id'
-  end
-  
-end