summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-06-10 23:07:31 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-07-16 22:23:15 +0200
commit0dc397478c2c526b0320f8d0d4e5f1ba54d4fcc7 (patch)
tree39cc7b15143473c69a648eb9830957ccf4b4cb4a /server
parentfdf6360e5cb94fa34fa82b18ce64ce61a27aec09 (diff)
downloadsonarqube-0dc397478c2c526b0320f8d0d4e5f1ba54d4fcc7.tar.gz
sonarqube-0dc397478c2c526b0320f8d0d4e5f1ba54d4fcc7.zip
SONAR-6716 Compress migrations of table rules
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/db/migrate/001_initial_schema.rb7
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/db/migrate/216_set_nullable_rule_name.rb39
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/db/migrate/380_add_status_language_and_dates_to_rules.rb34
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/db/migrate/382_remove_enabled_from_rules.rb31
4 files changed, 5 insertions, 106 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/001_initial_schema.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/001_initial_schema.rb
index c6d445033b8..5d3b7883a94 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/001_initial_schema.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/001_initial_schema.rb
@@ -85,15 +85,18 @@ class InitialSchema < ActiveRecord::Migration
end
create_table :rules do |t|
- t.column :name, :string, :null => false, :limit => 192
+ t.column :name, :string, :null => true, :limit => 200
t.column :plugin_rule_key, :string, :null => false, :limit => 200
t.column :plugin_config_key, :string, :null => true, :limit => 200
t.column :plugin_name, :string, :null => false, :limit => 255
t.column :description, :text, :null => true
t.column :priority, :integer, :null => true
- t.column :enabled, :boolean, :null => true
t.column :cardinality, :string, :null => true, :limit => 10
t.column :parent_id, :integer, :null => true
+ t.column 'status', :string, :null => true, :limit => 40
+ t.column 'language', :string, :null => true, :limit => 20
+ t.column 'created_at', :datetime, :null => true
+ t.column 'updated_at', :datetime, :null => true
end
create_table :rules_parameters do |t|
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/216_set_nullable_rule_name.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/216_set_nullable_rule_name.rb
deleted file mode 100644
index c953e4f1367..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/216_set_nullable_rule_name.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# SonarQube, open source software quality management tool.
-# Copyright (C) 2008-2014 SonarSource
-# mailto:contact AT sonarsource DOT com
-#
-# SonarQube is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 3 of the License, or (at your option) any later version.
-#
-# SonarQube is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-
-#
-# Sonar 2.10
-#
-class SetNullableRuleName < ActiveRecord::Migration
-
- class Rule < ActiveRecord::Base
- end
-
- def self.up
- add_column(:rules, :temp_name, :string, :limit => 200, :null => true)
-
- Rule.reset_column_information
- Rule.update_all('temp_name=name')
-
- remove_column(:rules, :name)
- rename_column(:rules, :temp_name, :name)
- end
-
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/380_add_status_language_and_dates_to_rules.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/380_add_status_language_and_dates_to_rules.rb
deleted file mode 100644
index 04f0da4ad79..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/380_add_status_language_and_dates_to_rules.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# SonarQube, open source software quality management tool.
-# Copyright (C) 2008-2014 SonarSource
-# mailto:contact AT sonarsource DOT com
-#
-# SonarQube is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 3 of the License, or (at your option) any later version.
-#
-# SonarQube is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-
-#
-# Sonar 3.6
-#
-class AddStatusLanguageAndDatesToRules < ActiveRecord::Migration
-
- def self.up
- add_column 'rules', 'status', :string, :null => true, :limit => 40
- add_column 'rules', 'language', :string, :null => true, :limit => 20
- add_column 'rules', 'created_at', :datetime, :null => true
- add_column 'rules', 'updated_at', :datetime, :null => true
- end
-
-end
-
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/382_remove_enabled_from_rules.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/382_remove_enabled_from_rules.rb
deleted file mode 100644
index d13fdc0e09a..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/382_remove_enabled_from_rules.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# SonarQube, open source software quality management tool.
-# Copyright (C) 2008-2014 SonarSource
-# mailto:contact AT sonarsource DOT com
-#
-# SonarQube is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 3 of the License, or (at your option) any later version.
-#
-# SonarQube is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-
-#
-# Sonar 3.6
-#
-class RemoveEnabledFromRules < ActiveRecord::Migration
-
- def self.up
- remove_column('rules', 'enabled')
- end
-
-end
-