t.column :name, :string, :null => true, :limit => 256
t.column :description, :string, :null => true, :limit => 2000
t.column :enabled, :boolean, :null => false, :default => true
+ t.column 'scope', :string, :limit => 3
+ t.column 'qualifier', :string, :limit => 3
+ t.column 'kee', :string, :limit => 400
+ t.column 'root_id', :integer
+ t.column :profile_id, :integer, :null => true
+ t.column :language, :string, :null => true, :limit => 5
+ t.column :copy_resource_id, :integer, :null => true
+ t.column :long_name, :string, :null => true, :limit => 256
end
create_table :snapshots do |t|
t.column :created_at, :datetime, :null => true, :default => nil
- t.column :version, :string, :null => false, :limit => 32
t.column :project_id, :integer, :null => false
t.column :parent_snapshot_id, :integer, :null => true
t.column :status, :string, :null => false, :default => 'U', :limit => 4
- t.column :purged, :boolean, :null => false, :default => false
t.column :islast, :boolean, :null => false, :default => false
-
+ t.column 'scope', :string, :limit => 3
+ t.column 'qualifier', :string, :limit => 3
+ t.column 'root_snapshot_id', :integer
+ t.column 'version', :string, :limit => 60, :null => true
+ t.column :path, :string, :null => true, :limit => 96
+ t.column :depth, :integer, :null => true
+ t.column :root_project_id, :integer, :nullable => true
end
create_table :metrics do |t|
t.column :name, :string, :null => false, :limit => 64
- t.column :value_type, :integer, :null => false
t.column :description, :string, :null => true, :limit => 255
t.column :direction, :integer, :null => false, :default => 0
+ t.column :domain, :string, :null => true, :limit => 64
+ t.column :short_name, :string, :null => true, :limit => 64
+ t.column :qualitative, :boolean, :null => false, :default => false
+ t.column :val_type, :string, :null => true, :limit => 8
+ t.column :user_managed, :boolean, :null => true, :default => false
+ t.column :enabled, :boolean, :null => true, :default => true
+ t.column :origin, :string, :null => true, :limit => 3
+ t.column 'worst_value', :decimal, :null => true, :precision => 30, :scale => 20
+ t.column 'best_value', :decimal, :null => true, :precision => 30, :scale => 20
+ t.column 'optimized_best_value', :boolean, :null => true
+ t.column 'hidden', :boolean, :null => true
end
create_table :project_measures do |t|
t.column :snapshot_id, :integer, :null => true
t.column :rule_id, :integer
t.column :rules_category_id, :integer
+ t.column :text_value, :string, :limit => 96, :null => true
+ t.column 'tendency', :integer, :null => true
+ t.column :measure_date, :datetime, :null => true
+ t.column :project_id, :integer, :null => true
+ t.column :alert_status, :string, :limit => 5, :null => true
+ t.column :alert_text, :string, :null => true, :limit => 4000
+ t.column :url, :string, :null => true, :limit => 2000
+ t.column :description, :string, :null => true, :limit => 4000
+ t.column :rule_priority, :integer, :null => true
+ t.column :diff_value_1, :decimal, :null => true, :precision => 30, :scale => 20
+ t.column :diff_value_2, :decimal, :null => true, :precision => 30, :scale => 20
+ t.column :diff_value_3, :decimal, :null => true, :precision => 30, :scale => 20
end
create_table :rules_categories do |t|
end
create_table :rules do |t|
- t.column :name, :string, :null => false, :limit => 128
+ t.column :name, :string, :null => false, :limit => 192
t.column :rules_category_id, :integer, :null => false
t.column :plugin_rule_key, :string, :null => false, :limit => 200
t.column :plugin_config_key, :string, :null => false, :limit => 200
t.column :plugin_name, :string, :null => false, :limit => 255
t.column :description, :text
+ t.column :priority, :integer, :null => true
end
create_table :rule_failures do |t|
t.column :rule_id, :integer, :null => false
t.column :failure_level, :integer, :null => false
t.column :message, :string, :limit => 500
+ t.column :line, :integer, :null => true
end
create_table :rules_parameters do |t|
add_index :rules_parameters, :rule_id, :name => 'rules_parameters_rule_id'
add_index :snapshots, :project_id, :name => 'snapshot_project_id'
+ add_index :snapshots, :parent_snapshot_id, :name => 'snapshots_parent'
+ add_index :snapshots, :root_snapshot_id, :name => 'snapshots_root'
add_index :metrics, :name, :unique => true, :name => 'metrics_unique_name'
end
+++ /dev/null
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2011 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
-#
-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, :qualitative, :boolean, :null => false, :default => false)
- end
-
-end
def self.up
create_table 'rules_profiles'do |t|
- t.column :name, :string, :limit => 40, :null => false
- t.column :active, :boolean, :default => false
+ t.column :name, :string, :limit => 100, :null => false
+ t.column :default_profile, :boolean, :default => false
+ t.column :provided, :boolean, :default => false, :null => false
+ t.column 'language', :string, :limit => 16, :null => true
end
create_table 'active_rules' do |t|
+++ /dev/null
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2011 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
-#
-class AddRulesProfilesProvidedColumn < ActiveRecord::Migration
-
- def self.up
- add_column(:rules_profiles, :provided, :boolean, :default => false, :null => false)
- Profile.reset_column_information
- end
-
-end
--- /dev/null
+#
+# Sonar, entreprise quality control tool.
+# Copyright (C) 2008-2011 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
+#
+
+class CreateSnapshotSources < ActiveRecord::Migration
+ def self.up
+ create_table :snapshot_sources do |t|
+ t.column :snapshot_id, :integer, :null => false
+ t.column :data, :text
+ end
+ add_index :snapshot_sources, :snapshot_id, :name => 'snap_sources_snapshot_id'
+ end
+end
\ No newline at end of file
+++ /dev/null
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2011 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
-#
-
-require 'project'
-
-class Project
- def branch
- read_attribute(:branch)
- end
-end
-
-class ProjectsToEntities < ActiveRecord::Migration
- def self.up
- add_column 'projects', 'scope', :string, :limit => 3
- add_column 'projects', 'qualifier', :string, :limit => 3
- add_column 'projects', 'kee', :string, :limit => 230
- add_column 'projects', 'root_id', :integer
-
- Project.reset_column_information
-
- upgrade_snapshots
- move_file_sources_to_snapshot_sources
-
- migrate_distribution_data
- end
-
- private
-
- def self.migrate_distribution_data
- add_column :project_measures, :text_value, :string, :limit => 96, :null => true
- ProjectMeasure.reset_column_information
- end
-
- def self.upgrade_snapshots
- add_column 'snapshots', 'scope', :string, :limit => 3
- add_column 'snapshots', 'qualifier', :string, :limit => 3
- add_column 'snapshots', 'root_snapshot_id', :integer
-
- remove_column 'snapshots', 'version'
- add_column 'snapshots', 'version', :string, :limit => 32
-
- Snapshot.reset_column_information
-
- begin
- remove_index :snapshots, :name => 'snapshot_created_at'
- rescue
- # the index does not exist (from 1.3)
- end
- add_index :snapshots, :parent_snapshot_id, :name => 'snapshots_parent'
- add_index :snapshots, :root_snapshot_id, :name => 'snapshots_root'
- end
-
- def self.move_file_sources_to_snapshot_sources
- create_table :snapshot_sources do |t|
- t.column :snapshot_id, :integer, :null => false
- t.column :data, :text
- end
- add_index :snapshot_sources, :snapshot_id, :name => 'snap_sources_snapshot_id'
- end
-
- class RuleFailure035 < ActiveRecord::Base
- set_table_name "rule_failures"
- end
-end
\ No newline at end of file
+++ /dev/null
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2011 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
-#
-class AddMeasureTendency < ActiveRecord::Migration
- def self.up
- add_column 'project_measures', 'tendency', :integer, :null => true
- ProjectMeasure.reset_column_information
- end
-
-end
\ No newline at end of file
+++ /dev/null
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2011 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
-#
-class AddRulesProfilesLanguage < ActiveRecord::Migration
-
- def self.up
- add_column 'rules_profiles', 'language', :string, :limit => 16, :null => true
- Profile.reset_column_information
- end
-end
+++ /dev/null
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2011 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
-#
-class IncreaseRulesNameSize < ActiveRecord::Migration
-
- def self.up
- change_column('rules', 'name', :string, :limit => 192)
- end
-
-end
+++ /dev/null
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2011 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
-#
-class SimplifyMetrics < ActiveRecord::Migration
-
- def self.up
- 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, :value_type)
-
- Metric.reset_column_information
- end
-end
+++ /dev/null
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2011 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
-#
-class RemoveExternalMeasuresTable < ActiveRecord::Migration
-
- def self.up
- add_columns_to_project_measures
- end
-
- def self.down
-
- end
-
-
- private
-
- def self.add_columns_to_project_measures
- add_column(:project_measures, :measure_date, :datetime, :null => true)
- add_column(:project_measures, :project_id, :integer, :null => true)
- change_column(:project_measures, :snapshot_id, :integer, :null => true)
- ProjectMeasure.reset_column_information
- end
-
-end
+++ /dev/null
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2011 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
-#
-class AddMetricsOriginColumn < ActiveRecord::Migration
-
- def self.up
- add_column(:metrics, :origin, :string, :null => true, :limit => 3)
- Metric.reset_column_information
- end
-
-end
t.column :value_error, :string, :limit => 64, :null => true
t.column :value_warning, :string, :limit => 64, :null => true
end
-
- add_column :project_measures, :alert_status, :string, :limit => 5, :null => true
-
end
end
+++ /dev/null
-#
-# Sonar, open source software quality management tool.
-# Copyright (C) 2008-2011 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
-#
-class CreateProfilesPerProject < ActiveRecord::Migration
-
- def self.up
- add_column :projects, :profile_id, :integer, :null => true
- Project.reset_column_information
- rename_column :rules_profiles, :active, :default_profile
- Profile.reset_column_information
- end
-
-end
\ No newline at end of file
+++ /dev/null
-#
-# Sonar, open source software quality management tool.
-# Copyright (C) 2008-2011 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
-#
-class EnsureMeasureSnapshotColumnNull < ActiveRecord::Migration
-
- def self.up
- # due to a migration issue under oracle with previous version, we have to make sure that this colum
- # is set to null even if already done in migration 49
- begin
- change_column(:project_measures, :snapshot_id, :integer, :null => true)
- rescue
- puts "project_measures.snapshot_id already set to nullable"
- end
-
- end
-
- def self.down
-
- end
-
-end
\ No newline at end of file
+++ /dev/null
-#
-# Sonar, open source software quality management tool.
-# Copyright (C) 2008-2011 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
-#
-class AddSnapshotsPath < ActiveRecord::Migration
-
- def self.up
- add_column(:snapshots, :path, :string, :null => true, :limit => 96)
- add_column(:snapshots, :depth, :integer, :null => true)
- Snapshot.reset_column_information
- end
-
- def self.down
-
- end
-
-end
\ No newline at end of file
+++ /dev/null
-#
-# Sonar, open source software quality management tool.
-# Copyright (C) 2008-2011 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
-#
-class AddPropertiesResource < ActiveRecord::Migration
-
- def self.up
- 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'
- end
-
-end
--- /dev/null
+#
+# Sonar, open source software quality management tool.
+# Copyright (C) 2008-2011 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
+#
+class CreateProperties < ActiveRecord::Migration
+
+ def self.up
+ create_table 'properties' do |t|
+ t.column :prop_key, :string, :limit => 512
+ t.column :resource_id, :integer, :null => true
+ t.column :text_value, :text, :null => true
+ end
+ add_index :properties, :prop_key, :name => 'properties_key'
+ end
+
+end
+++ /dev/null
-#
-# Sonar, open source software quality management tool.
-# Copyright (C) 2008-2011 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
-#
-class AddProjectLanguage < ActiveRecord::Migration
-
- def self.up
- add_column(:projects, :language, :string, :null => true, :limit => 5)
- Project.reset_column_information
- end
-
-end
t.column :data, :binary, :null => true
end
add_index :measure_data, :measure_id, :name => 'measure_data_measure_id'
- MeasureData061.reset_column_information
-
- add_column(:project_measures, :alert_text, :string, :null => true, :limit => 4000)
- add_column(:project_measures, :url, :string, :null => true, :limit => 2000)
- add_column(:project_measures, :description, :string, :null => true, :limit => 4000)
- ProjectMeasure.reset_column_information
+ MeasureData061.reset_column_information
end
class MeasureData061 < ActiveRecord::Base
set_table_name :measure_data
end
- class ProjectMeasure61 < ActiveRecord::Base
- set_table_name :project_measures
- end
-
end
\ No newline at end of file
+++ /dev/null
- #
- # Sonar, entreprise quality control tool.
- # Copyright (C) 2008-2011 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
- #
-class IncreaseSizeOfRulesProfilesName < ActiveRecord::Migration
-
- def self.up
- change_column('rules_profiles', 'name', :string, :limit => 100)
- end
-
-end
\ No newline at end of file
+++ /dev/null
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2011 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
-#
-class AddRulePriority < ActiveRecord::Migration
-
- def self.up
- add_column(:rules, :priority, :integer, :null => true)
- Rule.reset_column_information
-
- add_column(:project_measures, :rule_priority, :integer, :null => true)
- ProjectMeasure.reset_column_information
-
- violations = Metric.find(:first, :conditions => {:name => Metric::VIOLATIONS})
-
- mandatory_violations_density = Metric.find(:first, :conditions => {:name => 'mandatory_violations_density'})
- ProjectMeasure.delete_all("metric_id=" + mandatory_violations_density.id.to_s) if mandatory_violations_density
-
- mandatory_violations = Metric.find(:first, :conditions => {:name => 'mandatory_violations'})
- if mandatory_violations and violations
- ProjectMeasure.update_all("rule_priority=" + Sonar::RulePriority::PRIORITY_MAJOR.to_s, "metric_id=" + mandatory_violations.id.to_s)
- ProjectMeasure.update_all("metric_id=" + violations.id.to_s, "metric_id=" + mandatory_violations.id.to_s)
- end
-
- optional_violations = Metric.find(:first, :conditions => {:name => 'optional_violations'})
- if optional_violations and violations
- ProjectMeasure.update_all("rule_priority=" + Sonar::RulePriority::PRIORITY_INFO.to_s, "metric_id=" + optional_violations.id.to_s)
- ProjectMeasure.update_all("metric_id=" + violations.id.to_s, "metric_id=" + optional_violations.id.to_s)
- end
-
- #SONAR-1062 Active rules with optional level are not converted to priority INFO during 1.10 migration
- ActiveRule.update_all('failure_level=0', 'failure_level=1')
- end
-
-end
\ No newline at end of file
+++ /dev/null
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2011 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
-#
-class AddDiffColumnsToMeasures < ActiveRecord::Migration
-
- def self.up
- add_column(:project_measures, :diff_value_1, :decimal, :null => true, :precision => 30, :scale => 20)
- add_column(:project_measures, :diff_value_2, :decimal, :null => true, :precision => 30, :scale => 20)
- add_column(:project_measures, :diff_value_3, :decimal, :null => true, :precision => 30, :scale => 20)
- end
-
-end
\ No newline at end of file
+++ /dev/null
- #
- # Sonar, entreprise quality control tool.
- # Copyright (C) 2008-2011 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
- #
-class DeleteSnapshotsPurged < ActiveRecord::Migration
-
- def self.up
- remove_column(:snapshots, :purged)
- Snapshot.reset_column_information
- end
-end
\ No newline at end of file
+++ /dev/null
- #
- # Sonar, entreprise quality control tool.
- # Copyright (C) 2008-2011 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
- #
-class AddLineToRuleFailures < ActiveRecord::Migration
-
- def self.up
- add_column :rule_failures, :line, :integer, :null => true
- RuleFailure.reset_column_information
- end
-
-end
\ No newline at end of file
+++ /dev/null
- #
- # Sonar, entreprise quality control tool.
- # Copyright (C) 2008-2011 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
- #
-class ResetTendencyDepth < ActiveRecord::Migration
-
- def self.up
- begin
- Property.delete_all("prop_key='tendency.depth'")
- rescue
- end
- end
-
-end
\ No newline at end of file
+++ /dev/null
- #
- # Sonar, entreprise quality control tool.
- # Copyright (C) 2008-2011 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
- #
-class UpgradePropertiesToBlobs < ActiveRecord::Migration
-
- def self.up
- add_column(:properties, :text_value, :text, :null => true)
- Property.reset_column_information
-
- Property.find(:all).each do |p|
- p.text_value=p.prop_value
- p.save!
- end
-
- remove_column(:properties, :prop_value)
- Property.reset_column_information
- end
-
-end
\ No newline at end of file
+++ /dev/null
- #
- # Sonar, entreprise quality control tool.
- # Copyright (C) 2008-2011 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
- #
-class AddCopyResourceIdToProjects < ActiveRecord::Migration
-
- def self.up
- add_column(:projects, :copy_resource_id, :integer, :null => true)
- end
-
-end
\ No newline at end of file
+++ /dev/null
- #
- # Sonar, entreprise quality control tool.
- # Copyright (C) 2008-2011 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
- #
-class IncreaseProjectKeeSize < ActiveRecord::Migration
-
- def self.up
- change_column('projects', 'kee', :string, :limit => 400)
- end
-
-end
\ No newline at end of file
+++ /dev/null
- #
- # Sonar, entreprise quality control tool.
- # Copyright (C) 2008-2011 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
- #
-class AddProjectsLongName < ActiveRecord::Migration
-
- def self.up
- add_column :projects, :long_name, :string, :null => true, :limit => 256
- Project.reset_column_information
- end
-
-end
\ No newline at end of file
+++ /dev/null
- #
- # Sonar, entreprise quality control tool.
- # Copyright (C) 2008-2011 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
- #
-class IncludeBranchInProjectName < ActiveRecord::Migration
-
- def self.up
- Project.find(:all, :conditions => {:scope => Project::SCOPE_SET, :qualifier => Project::QUALIFIER_PROJECT}).each do |project|
- branch=branch(project)
- if branch
- project.name+= ' ' + branch
- project.save!
- end
- end
- end
-
- private
- def self.branch(project)
- s=project.kee.split(':')
- if s.size>=3
- return s[2]
- end
- nil
- end
-end
\ No newline at end of file
+++ /dev/null
- #
- # Sonar, entreprise quality control tool.
- # Copyright (C) 2008-2011 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
- #
-class DeleteSomeFindbugsRules < ActiveRecord::Migration
-
- def self.up
- delete_rule('EQ_DOESNT_OVERRIDE_EQUALS')
- delete_rule('OBL_UNSATISFIED_OBLIGATION')
- end
-
- private
- def self.delete_rule(rule_key)
- rule=Rule.find(:first, :conditions => {:plugin_name => 'findbugs', :plugin_rule_key => rule_key})
- if rule
- say_with_time "Deleting Findbugs rule #{rule_key}..." do
- rule_id=rule.id
- ActiveRule.delete_all(["rule_id=?", rule_id])
- rule.delete
- end
- end
- end
-end
\ No newline at end of file
+++ /dev/null
- #
- # Sonar, entreprise quality control tool.
- # Copyright (C) 2008-2011 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
- #
-
-# see SONAR-1075
-class AddMetricValueLimits < ActiveRecord::Migration
-
- def self.up
- add_column 'metrics', 'worst_value', :decimal, :null => true, :precision => 30, :scale => 20
- add_column 'metrics', 'best_value', :decimal, :null => true, :precision => 30, :scale => 20
- add_column 'metrics', 'optimized_best_value', :boolean, :null => true
- end
-
- def self.down
- remove_column 'metrics', 'worst_value'
- remove_column 'metrics', 'best_value'
- remove_column 'metrics', 'optimized_best_value'
- end
-end
\ No newline at end of file
end
- def self.down
-
- end
-
end
+++ /dev/null
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2011 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
-#
-class AddRootProjectIdToSnapshots < ActiveRecord::Migration
-
- def self.up
- add_column(:snapshots, :root_project_id, :integer, :nullable => true)
- Snapshot.reset_column_information
- end
-
- def self.down
-
- end
-
-end
+++ /dev/null
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2011 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
-#
-class FillSnapshotsRootProjectId < ActiveRecord::Migration
-
- def self.up
- snapshots=Snapshot.find(:all, :select => 'id,root_snapshot_id', :conditions => ['islast=?', true])
- root_sids=[]
- snapshots.each do |s|
- root_sids<< (s.root_snapshot_id || s.id)
- end
- root_sids=root_sids.uniq.compact
-
- root_sids.each do |root_sid|
- root_snapshot=Snapshot.find(:first, :conditions => {:id => root_sid})
- if root_snapshot
- Snapshot.update_all("root_project_id=#{root_snapshot.project_id}", ['root_snapshot_id=? or id=?', root_sid, root_sid])
- end
- end
- end
-
- def self.down
-
- end
-
-end
t.column :from_resource_id, :integer, :null => true
t.column :to_snapshot_id, :integer, :null => true
t.column :to_resource_id, :integer, :null => true
- t.column :dep_usage, :string, :null => true, :limit => 15
+ t.column :dep_usage, :string, :null => true, :limit => 30
t.column :dep_weight, :integer, :null => true
t.column :project_snapshot_id, :integer, :null => true
t.column :parent_dependency_id, :big_integer, :null => true
add_index :dependencies, :to_snapshot_id, :name => 'deps_to_sid'
end
- def self.down
- remove_index :dependencies, :name => 'deps_from_sid'
- remove_index :dependencies, :name => 'deps_to_sid'
- drop_table :dependencies
- end
-
end
+++ /dev/null
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2011 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
-#
-class AddMetricsHiddenColumn < ActiveRecord::Migration
-
- def self.up
- add_column 'metrics', 'hidden', :boolean, :null => true
- Metric.reset_column_information
- Metric.clear_cache
- end
-
- def self.down
- remove_column 'metrics', 'hidden'
- end
-end
alter_to_big_integer('async_measure_snapshots', 'project_measure_id', 'async_m_s_measure_id')
end
- def self.down
-
- end
end
+++ /dev/null
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2011 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
-#
-class IncreaseDepUsageSize < ActiveRecord::Migration
-
- def self.up
- change_column('dependencies', 'dep_usage', :string, :limit => 30, :null => true)
- end
-
- def self.down
-
- end
-end
+++ /dev/null
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2011 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
-#
-class IncreaseSnapshotsVersion < ActiveRecord::Migration
-
- def self.up
- change_column('snapshots', 'version', :string, :limit => 60, :null => true)
- end
-
- def self.down
-
- end
-end
+++ /dev/null
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2011 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
-#
-class DeleteDeprecatedLibraries < ActiveRecord::Migration
-
- def self.up
- say_with_time "Deleting deprecated dependencies on libs..." do
- Dependency.delete_all("from_scope='LIB' OR to_scope='LIB'")
- end
-
- say_with_time "Deleting deprecated snapshots on libs..." do
- Snapshot.delete_all("scope='LIB'")
- end
-
- say_with_time "Deleting deprecated libs..." do
- Project.delete_all("scope='LIB'")
- end
- end
-
- def self.down
-
- end
-end
+++ /dev/null
- #
- # Sonar, entreprise quality control tool.
- # Copyright (C) 2008-2011 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
- #
-class DeleteCheckstyleRegexpRules < ActiveRecord::Migration
-
- def self.up
- delete_rule('com.puppycrawl.tools.checkstyle.checks.RegexpMultilineCheck')
- delete_rule('com.puppycrawl.tools.checkstyle.checks.RegexpSinglelineCheck')
- delete_rule('com.puppycrawl.tools.checkstyle.checks.RegexpSinglelineJavaCheck')
- 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