Commit ad76a2b4 authored by Sean McGivern's avatar Sean McGivern

Fix EE-specific migration method signature

`foreign_key_exists?` was changed upstream; this migration doesn't need to
define its own version any more.
parent 9090a100
...@@ -6,7 +6,7 @@ class AddGroupBoardsIndexes < ActiveRecord::Migration ...@@ -6,7 +6,7 @@ class AddGroupBoardsIndexes < ActiveRecord::Migration
DOWNTIME = false DOWNTIME = false
def up def up
return if foreign_key_exists?(:boards, :group_id) return if foreign_key_exists?(:boards, :groups, column: :group_id)
add_concurrent_foreign_key :boards, :namespaces, column: :group_id, on_delete: :cascade add_concurrent_foreign_key :boards, :namespaces, column: :group_id, on_delete: :cascade
...@@ -14,18 +14,10 @@ class AddGroupBoardsIndexes < ActiveRecord::Migration ...@@ -14,18 +14,10 @@ class AddGroupBoardsIndexes < ActiveRecord::Migration
end end
def down def down
return unless foreign_key_exists?(:boards, :group_id) return unless foreign_key_exists?(:boards, :groups, column: :group_id)
remove_foreign_key :boards, column: :group_id remove_foreign_key :boards, column: :group_id
remove_concurrent_index :boards, :group_id remove_concurrent_index :boards, :group_id
end end
private
def foreign_key_exists?(table, column)
foreign_keys(table).any? do |key|
key.options[:column] == column.to_s
end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment