Notes
- If using references, the table you are referring to must already exists.
- You can debug migrations errors by looking at the issued statements in the logs.
add_index
,add_foreign_key
are more flexible thant.references
and itsforeign_key
option.- .. but why?
- Docs https://api.rubyonrails.org/v4.2.8/
- Docs https://dev.mysql.com/doc/refman/5.6/en/alter-table.html