lib/schema_plus/foreign_keys/active_record/connection_adapters/abstract_adapter.rb
# Define a foreign key constraint.  Valid options are :on_update,
# :on_delete, and :deferrable, with values as described at
# ConnectionAdapters::ForeignKeyDefinition
#
# (NOTE: Sqlite3 does not support altering a table to add foreign-key
# constraints; they must be included in the table specification when
# it's created.  If you're using Sqlite3, this method will raise an
# error.)
Define a foreign key constraint.

Sqlite3 does not support altering a table to add foreign-key
constraints; they must be included in the table specification when
it's created.  If you're using Sqlite3, this method will raise an
error.)
Define a foreign key constraint . Sqlite3 does not support altering a table to add foreign - key constraints ; they must be included in the table specification when it ' s created . If you ' re using Sqlite3 this method will raise an error . )
def add_foreign_key(from_table, to_table, **options) 
          options = options.dup
          options[:column] ||= foreign_key_column_for(to_table)
          foreign_key_sql = add_foreign_key_sql(from_table, to_table, options)
          execute "ALTER TABLE #{quote_table_name(from_table)} #{foreign_key_sql}"
        end
def add_foreign_key ( from_table , to_table , ** options ) options = options . dup options [ :column ] ||= foreign_key_column_for ( to_table ) foreign_key_sql = add_foreign_key_sql ( from_table , to_table , options ) execute "ALTER TABLE #{quote_table_name(from_table)} #{foreign_key_sql}" end
Define a foreign key constraint.
Define a foreign key constraint .
# (table_name, column, to_table, primary_key, options = {})
from_table
to_table
options