add_foreign_key
seems to be behaving inconsistently when it is called with rake db:rollback
.
When called from rake db:migrate
, a custom name built with table name & column name is used for the index name.
When called from rake db:rollback
, the name used for the index is a generic one.
Here is the diff from the above behavior in my db/schema.rb
file:
- add_index "line_items", ["location_id"], name: "index_line_items_on_location_id", using: :btree
+ add_index "line_items", ["location_id"], name: "fk_rails_4335959382", using: :btree
rails version: 4.2.0
ruby version: 2.2.0p0