Method: MigrationConstraintHelpers#drop_foreign_key
- Defined in:
- lib/migration_helpers/lib/migration_helper.rb
#drop_foreign_key(table, field) ⇒ Object
Drops a foreign key from table
.field
that has been created before with foreign_key method
table: The table name field: A field (or array of fields) of the table
22 23 24 |
# File 'lib/migration_helpers/lib/migration_helper.rb', line 22 def drop_foreign_key(table, field) execute "ALTER TABLE #{table} DROP FOREIGN KEY #{constraint_name(table, field)}" end |