rsim/oracle-enhanced — pull request #264 by neojin (2012-12-18 06:12:06+00:00)
Title: add_foreign_key fix when primary_key is not 'id'

When adding a foreign key and the foreign table's primary key is not 'id', the function `add_foreign_key` is setting `:primary_key => nil` . I printed the output of `foreign_key.options` on some of my tables:

`{:name=>"fk_instructor_person_id", :columns=>["person_id"], :references=>["personid"], :dependent=>nil}`

As you can see, there is no :primary_key key. This is on Oracle 11g release 2.

Instead, I replaced it with `foreign_key.options[:references].first.inspect`, and now it is working.

PS I am sorry about all the commits, I was using github's editor.