method

foreign_key

rails latest stable - Class: ActiveRecord::ConnectionAdapters::Table

Method not available on this version

This method is only available on newer versions. The first available version (v5.0.0.1) is shown here.

foreign_key(*args)
public

Adds a foreign key.

t.foreign_key(:authors)

See {connection.add_foreign_key}[rdoc-ref:SchemaStatements#add_foreign_key]