method
invert_add_foreign_key
v4.2.1 -
Show latest stable
- Class:
ActiveRecord::Migration::CommandRecorder
invert_add_foreign_key(args)private
No documentation available.
# File activerecord/lib/active_record/migration/command_recorder.rb, line 172
def invert_add_foreign_key(args)
from_table, to_table, add_options = args
add_options ||= {}
if add_options[:name]
options = { name: add_options[:name] }
elsif add_options[:column]
options = { column: add_options[:column] }
else
options = to_table
end
[:remove_foreign_key, [from_table, options]]
end