diff options
author | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2015-03-23 11:29:03 +0100 |
---|---|---|
committer | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2015-03-26 14:51:08 +0100 |
commit | ac006c9d0639beb12c69b6db24c7b48d0f4ea064 (patch) | |
tree | 2a473128beb059f647f2d5bf55d10c875f97b59f /server | |
parent | dd25739100ba7e9b2ad426e8b635692241387465 (diff) | |
download | sonarqube-ac006c9d0639beb12c69b6db24c7b48d0f4ea064.tar.gz sonarqube-ac006c9d0639beb12c69b6db24c7b48d0f4ea064.zip |
SONAR-6327 Add is_default column to rules_profiles
Diffstat (limited to 'server')
7 files changed, 38 insertions, 7 deletions
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/qualityprofile/db/ActiveRuleDaoTest/empty.xml b/server/sonar-server/src/test/resources/org/sonar/server/qualityprofile/db/ActiveRuleDaoTest/empty.xml index 9e4f1eb56f2..af2060c5dcd 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/qualityprofile/db/ActiveRuleDaoTest/empty.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/qualityprofile/db/ActiveRuleDaoTest/empty.xml @@ -5,5 +5,5 @@ plugin_config_key="Parent1" priority="2" is_template="[false]" language="golo" created_at="1981-10-24 15:20:00" /> <rules_profiles id="1" name="Child" language="java" parent_name="Parent" version="1" - used_profile="[false]"/> + used_profile="[false]" is_default="[false]"/> </dataset> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/qualityprofile/db/ActiveRuleDaoTest/insert_parameter.xml b/server/sonar-server/src/test/resources/org/sonar/server/qualityprofile/db/ActiveRuleDaoTest/insert_parameter.xml index a13d968365d..780a93bd3dc 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/qualityprofile/db/ActiveRuleDaoTest/insert_parameter.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/qualityprofile/db/ActiveRuleDaoTest/insert_parameter.xml @@ -7,5 +7,5 @@ plugin_config_key="Parent1" priority="2" is_template="[false]" language="golo" created_at="1981-10-24 15:20:00" /> <rules_profiles id="1" name="Child" language="java" parent_name="Parent" version="1" - used_profile="[false]"/> + used_profile="[false]" is_default="[false]"/> </dataset> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/qualityprofile/db/ActiveRuleDaoTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/qualityprofile/db/ActiveRuleDaoTest/shared.xml index bf9ee7ff04e..67a66c3adda 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/qualityprofile/db/ActiveRuleDaoTest/shared.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/qualityprofile/db/ActiveRuleDaoTest/shared.xml @@ -18,9 +18,9 @@ <active_rule_parameters id="3" active_rule_id="2" rules_parameter_id="1" rules_parameter_key="max" value="15"/> <rules_profiles id="1" name="Child" language="java" parent_name="Parent" version="1" - used_profile="[false]"/> + used_profile="[false]" is_default="[false]"/> <rules_profiles id="2" name="Parent" language="java" parent_name="[null]" version="1" - used_profile="[false]"/> + used_profile="[false]" is_default="[false]"/> </dataset> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rule_params-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rule_params-result.xml index 11ede736fd2..42737fdef0a 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rule_params-result.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rule_params-result.xml @@ -9,7 +9,7 @@ <rules_parameters id="1" rule_id="1" default_value="default value one" description="parameter one" name="param1" param_type="STRING"/> <rules_parameters id="2" rule_id="1" default_value="default value two" description="parameter two" name="param2" param_type="STRING"/> - <rules_profiles id="1" version="1" used_profile="true" name="profile name" language="java" /> + <rules_profiles id="1" version="1" used_profile="true" name="profile name" language="java" is_default="[false]"/> <active_rules created_at="[null]" updated_at="[null]" id="1" rule_id="1" profile_id="1" failure_level="4" inheritance="[null]" /> <active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" value="one" rules_parameter_key="[null]"/> <active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" value="two" rules_parameter_key="[null]"/> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rule_params.xml b/server/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rule_params.xml index c8ab86530c0..38b34acb5c5 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rule_params.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rule_params.xml @@ -10,7 +10,7 @@ <rules_parameters id="3" rule_id="1" name="param3" description="[null]" param_type="STRING"/> - <rules_profiles id="1" version="1" used_profile="true" name="profile name" language="java" /> + <rules_profiles id="1" version="1" used_profile="true" name="profile name" language="java" is_default="[false]"/> <active_rules created_at="[null]" updated_at="[null]" id="1" rule_id="1" profile_id="1" failure_level="4" /> <active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" value="one" /> <active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" value="two" /> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rules.xml b/server/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rules.xml index 6d205ac7231..e4ea6ca07f1 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rules.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rules.xml @@ -8,7 +8,7 @@ <rules_parameters id="1" rule_id="1" name="deprecated-prop" description="[null]" param_type="STRING"/> - <rules_profiles id="1" version="1" used_profile="true" name="sonar way" language="java" /> + <rules_profiles id="1" version="1" used_profile="true" name="sonar way" language="java" is_default="[false]"/> <active_rules created_at="[null]" updated_at="[null]" id="1" rule_id="1" profile_id="1" failure_level="4" /> <active_rules created_at="[null]" updated_at="[null]" id="2" rule_id="2" profile_id="1" failure_level="0" /> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/907_add_rules_profiles_is_default.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/907_add_rules_profiles_is_default.rb new file mode 100644 index 00000000000..9c65e5a0248 --- /dev/null +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/907_add_rules_profiles_is_default.rb @@ -0,0 +1,31 @@ +# +# SonarQube, open source software quality management tool. +# Copyright (C) 2008-2014 SonarSource +# mailto:contact AT sonarsource DOT com +# +# SonarQube is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 3 of the License, or (at your option) any later version. +# +# SonarQube is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# + +# +# SonarQube 5.2 +# SONAR-6237 +# +class AddRulesProfilesIsDefault < ActiveRecord::Migration + + def self.up + add_column 'rules_profiles', 'is_default', :boolean, :null => false, :default => false + end + +end |