Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

add index for other direction of relations

ulfertsb02e738bb976
diff --git a/db/migrate/20220319211253_add_parent_id_to_wp.rb b/db/migrate/20220319211253_add_parent_id_to_wp.rb
index fab053bead9..781f66891fe 100644
--- a/db/migrate/20220319211253_add_parent_id_to_wp.rb
+++ b/db/migrate/20220319211253_add_parent_id_to_wp.rb
@@ -166,6 +166,8 @@ class AddParentIdToWp < ActiveRecord::Migration[6.1]
def add_relation_index
add_index :relations, %i[from_id to_id relation_type],
unique: true
+ add_index :relations, %i[to_id from_id relation_type],
+ unique: true
end
def add_parent_index