aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2015-04-21 17:30:16 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2015-04-21 17:34:06 +0200
commite58da285fd128f71ad8ac8c4a31890a25d64bc36 (patch)
treebdf75aad7cc9892804b1eadb6ffa8b9541a6344d /server/sonar-web/src/main
parentc83af35f044f23b698ba23dca7097546b1eb2a13 (diff)
downloadsonarqube-e58da285fd128f71ad8ac8c4a31890a25d64bc36.tar.gz
sonarqube-e58da285fd128f71ad8ac8c4a31890a25d64bc36.zip
SONAR-6256 Drop dependencies.from_resource_id and dependencies.to_resource_id
Diffstat (limited to 'server/sonar-web/src/main')
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/dependency_tree_controller.rb2
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/models/dependency.rb4
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/db/migrate/911_remove_dependencies_component_ids.rb31
3 files changed, 34 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/dependency_tree_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/dependency_tree_controller.rb
index 0d93e544c18..12222ce82fc 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/dependency_tree_controller.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/dependency_tree_controller.rb
@@ -66,7 +66,7 @@ class Api::DependencyTreeController < Api::ApiController
dependencies.each do |dep|
hash={
:did => dep.id.to_s,
- :rid => dep.to_resource_id.to_s,
+ :rid => dep.to.id.to_s,
:w => dep.weight,
:u => dep.usage,
:s => dep.to_scope,
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/models/dependency.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/models/dependency.rb
index c6ff4617d0f..7505640f1ca 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/models/dependency.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/models/dependency.rb
@@ -18,10 +18,10 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
class Dependency < ActiveRecord::Base
- belongs_to :from, :class_name => 'Project', :foreign_key => 'from_resource_id'
+ belongs_to :from, :class_name => 'Project', :foreign_key => 'from_component_uuid', :primary_key => 'uuid'
belongs_to :from_snapshot, :class_name => 'Snapshot', :foreign_key => 'from_snapshot_id'
- belongs_to :to, :class_name => 'Project', :foreign_key => 'to_resource_id'
+ belongs_to :to, :class_name => 'Project', :foreign_key => 'to_component_uuid', :primary_key => 'uuid'
belongs_to :to_snapshot, :class_name => 'Snapshot', :foreign_key => 'to_snapshot_id'
belongs_to :project, :class_name => 'Project', :foreign_key => 'project_id'
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/911_remove_dependencies_component_ids.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/911_remove_dependencies_component_ids.rb
new file mode 100644
index 00000000000..623c6e36709
--- /dev/null
+++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/911_remove_dependencies_component_ids.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-6256
+#
+class RemoveDependenciesComponentIds < ActiveRecord::Migration
+
+ def self.up
+ execute_java_migration('org.sonar.server.db.migrations.v52.DropDependenciesComponentColumns')
+ end
+
+end