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
Updated by The Foreman Bot over 8 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/3747 added
Updated by Dominic Cleal over 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset aeb74d31ad752779b2d3e65410e53297600f376d.
Updated by Dominic Cleal over 8 years ago
- Translation missing: en.field_release set to 160
Actions