I am developing a Ruby on Rails application, and using the foreigner plugin to set up foreign key constraints in the migrations for example like this.
add_foreign_key(:notifications, :invitations, :dependent => :delete)
However, when I run the migration with
rake db:migrate
It runs, but my schema.rb file remains unchanged. Shouldn’t the changes be reflected there for setup on another database?
So, thanks to ctilly79 I found the answer. For some reason I thought that since I was using SQLite it would still make the foreign keys in Schema.rb for use in production. This is not the case. You have to be using something that supports foreign keys such as MySQL for it to work.