For a long time I have been searching for built-in foreign keys in Ruby on Rails. For some reason, the core developers don’t think it’s particularly important. I don’t know why. I think foreign key constraints are absolutely essential, but who am I?
The sad state of foreign key constraints is reflected in the amount of plugins available (very few) and the quality of them (poor, or abandoned). Until now! I discovered Foreigner, a well-maintained gem on github/gemcutter that allows me to add foreign keys inside migrations. I just tried it out and it works very well. I have a feeling this will finally allow me to develop on SQLite locally and PostgreSQL on the server.
Glad to here you’re happy with it! (I just did a little search to see if any sites link to it)
It’s still one of my favourite plugins and I use it on every project. And yes, I have been using the SQLite/PostgreSQL combo a lot!