module Fakey::MysqlAdapter

Public Instance Methods

add_foreign_key(to_table, column, options={}) click to toggle source
# File lib/fakey/mysql_adapter.rb, line 3
def add_foreign_key(to_table, column, options={})
  to_table = options[:references] if options[:references]
  referenced_column = options[:referenced_column] || primary_key(to_table)
  "FOREIGN KEY(#{quote_column_name(column)}) REFERENCES #{quote_table_name(to_table)} (#{referenced_column})"
end