I use Oracle and i really want to use migrations, but there seems to be no way to setup foreign key constraints. Is this true? If it is then doesn''t that make migrations useles with Oracle? Thanks Chris -- Posted via http://www.ruby-forum.com/.
Alan Francis
2006-Jul-10 15:52 UTC
[Rails] Re: Can migrations set up foreign key references?
Chris wrote:> I use Oracle and i really want to use migrations, but there seems to be > no way to setup foreign key constraints.> Is this true?Yes.> If it is then > doesn''t that make migrations useles with Oracle?No. It makes migrations useless with any db *here you want to use constraints*. You can easily get by without them, and migrations benefits are worth it. However, I made a little simple plugin which now supports MySQL and PostGres. http://blog.alancfrancis.com/2006/07/add_foreign_key.html If you were to send me ( gmail: alancfrancis) the syntax for adding and removing a foreign key to an Oracle DB, I''ll update the plugin over the next day or so. A. -- Posted via http://www.ruby-forum.com/.
> No. It makes migrations useless with any db *here you want to use > constraints*. You can easily get by without them, and migrations > benefits are worth it.Doesn''t Oracle use foreign keys to somehow speed up queries? ..i think it might. -- Posted via http://www.ruby-forum.com/.
Iain D Broadfoot
2006-Jul-10 17:36 UTC
[Rails] Re: Can migrations set up foreign key references?
Alan Francis said something:> However, I made a little simple plugin which now supports MySQL and > PostGres.There is also the Foreign Key Migrations plugin: http://www.redhillconsulting.com.au/rails_plugins.html which sets up constraints automatically, so a column customer_id will set up an fk constraint on customers(id). This feels very railsy, as no extra config is needed. iain -- "If sharing a thing in no way diminishes it, it is not rightly owned if it is not shared." -- St. Augustine #rm -rf / http://www.geeksoc.org/