diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-08-31 19:27:13 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-09-01 00:46:32 +0400 |
commit | 7cf051c0f7d8ec017381b05c85044e9321c6c4f7 (patch) | |
tree | 8c06051077ea988f479ec0d2a30ac459baf56c1d /sonar-server/src | |
parent | 8e085c96accc9c912747df5c8b93c8a0bc85ad95 (diff) | |
download | sonarqube-7cf051c0f7d8ec017381b05c85044e9321c6c4f7.tar.gz sonarqube-7cf051c0f7d8ec017381b05c85044e9321c6c4f7.zip |
SONAR-1091 Add CPD over different projects
* Add table clone_blocks
* Add DbCloneIndex, which can be activated in sonar-cpd-plugin using
property "sonar.cpd.cross_project=true"
Diffstat (limited to 'sonar-server/src')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/db/migrate/217_create_clone_blocks.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/217_create_clone_blocks.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/217_create_clone_blocks.rb new file mode 100644 index 00000000000..abd611c748a --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/217_create_clone_blocks.rb @@ -0,0 +1,40 @@ +# +# 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 +# + +# +# Sonar 2.11 +# +class CreateCloneBlocks < ActiveRecord::Migration + + def self.up + create_table :clone_blocks do |t| + t.column :snapshot_id, :integer, :null => false + t.column :hash, :string, :null => false, :limit => 50 + t.column :resource_key, :string, :null => false, :limit => 400 + t.column :index_in_file, :integer, :null => false + t.column :start_line, :integer, :null => false + t.column :end_line, :integer, :null => false + end + + add_index :clone_blocks, :hash, :name => 'clone_blocks_hash' + add_index :clone_blocks, [:snapshot_id, :resource_key], :name => 'clone_blocks_resource' + end + +end |