Actions
Bug #16194
closedremove_foreign_key called from RemoveAuditUserFk with wrong table name
Description
The 20141120140051 RemoveAuditUserFk database migration calls remove_foreign_key
with the table name user
rather than users
. On Rails 4.2 this seems to work, but under Rails 5.0, it raises an error:
== 20141120140051 RemoveAuditUserFk: migrating ================================ -- remove_foreign_key(:audits, :user) rake aborted! StandardError: An error has occurred, all later migrations canceled: Table 'audits' has no foreign key for user activerecord-5.0.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:970:in `foreign_key_for!' activerecord-5.0.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:940:in `remove_foreign_key'
Docs seem to suggest it must be the table name, which is plural: http://apidock.com/rails/ActiveRecord/ConnectionAdapters/SchemaStatements/remove_foreign_key
Actions