diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2013-06-11 10:27:42 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2013-06-11 10:27:42 +0200 |
commit | a384ced603ce00b9f6f9590d345808dd933e730b (patch) | |
tree | 7cfc9d4a84b7489648a6c0706ff63c9ac3528dfb /sonar-server/src | |
parent | 39dd68b5054ef5e3c136efad0ad4c98d263a498a (diff) | |
download | sonarqube-a384ced603ce00b9f6f9590d345808dd933e730b.tar.gz sonarqube-a384ced603ce00b9f6f9590d345808dd933e730b.zip |
SONAR-4383 Add IssueFilters db creation script and DAO
Diffstat (limited to 'sonar-server/src')
4 files changed, 109 insertions, 0 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/issue/IssueFilterService.java b/sonar-server/src/main/java/org/sonar/server/issue/IssueFilterService.java new file mode 100644 index 00000000000..d4364d26946 --- /dev/null +++ b/sonar-server/src/main/java/org/sonar/server/issue/IssueFilterService.java @@ -0,0 +1,33 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2013 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. + */ + +package org.sonar.server.issue; + +import org.sonar.api.ServerComponent; +import org.sonar.core.issue.db.IssueFilterDao; + +public class IssueFilterService implements ServerComponent { + + private IssueFilterDao issueFilterDao; + + public IssueFilterService(IssueFilterDao issueFilterDao) { + this.issueFilterDao = issueFilterDao; + } +} diff --git a/sonar-server/src/main/java/org/sonar/server/platform/Platform.java b/sonar-server/src/main/java/org/sonar/server/platform/Platform.java index 8a52b6f8124..1878f6de95c 100644 --- a/sonar-server/src/main/java/org/sonar/server/platform/Platform.java +++ b/sonar-server/src/main/java/org/sonar/server/platform/Platform.java @@ -273,6 +273,7 @@ public final class Platform { servicesContainer.addSingleton(IssueNotifications.class); servicesContainer.addSingleton(ActionService.class); servicesContainer.addSingleton(Actions.class); + servicesContainer.addSingleton(IssueFilterService.class); // rules servicesContainer.addSingleton(RubyRuleService.class); diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/410_create_issue_filters.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/410_create_issue_filters.rb new file mode 100644 index 00000000000..ff63ed785b4 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/410_create_issue_filters.rb @@ -0,0 +1,38 @@ +# +# Sonar, entreprise quality control tool. +# Copyright (C) 2008-2013 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 +# See SONAR-4383 +# +class CreateIssueFilters < ActiveRecord::Migration + + def self.up + create_table 'issue_filters' do |t| + t.column 'name', :string, :null => false, :limit => 100 + t.column 'user_id', :integer, :null => true + t.column 'shared', :boolean, :default => false, :null => false + t.column 'description', :string, :null => true, :limit => 4000 + t.column 'data', :text, :null => true + t.timestamps + end + add_index 'issue_filters', 'name', :name => 'issue_filters_name' + end + +end
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/411_create_issue_filter_favourites.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/411_create_issue_filter_favourites.rb new file mode 100644 index 00000000000..322c19aaa53 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/411_create_issue_filter_favourites.rb @@ -0,0 +1,37 @@ +# +# Sonar, entreprise quality control tool. +# Copyright (C) 2008-2013 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 +# See SONAR-4383 +# +class CreateIssueFilterFavourites < ActiveRecord::Migration + + def self.up + create_table 'issue_filter_favourites' do |t| + t.column 'user_id', :integer, :null => false + t.column 'issue_filter_id', :integer, :null => false + t.column 'created_at', :datetime + end + add_index 'issue_filter_favourites', 'user_id', :name => 'issue_filter_favs_userid' + end + +end + |