class ActiveRecord::ConnectionAdapters::Table
def foreign_key(*args, **options)
t.foreign_key(:authors, column: :author_id, primary_key: "id")
t.foreign_key(:authors)
Adds a foreign key to the table using a supplied table name.
def foreign_key(*args, **options) raise_on_if_exist_options(options) @base.add_foreign_key(name, *args, **options) end