Ruby on Rails Foreigner plugin not working for SQL Server

Posted by Earlz on Stack Overflow See other posts from Stack Overflow or by Earlz
Published on 2010-04-07T21:34:30Z Indexed on 2010/04/07 22:43 UTC
Read the original article Hit count: 439

Well, now that I've finally got my stupid ODBC stuff configured, I took a schema.rb file that I dumped from a Postgres database and did a db:schema:load on it in a Rails project configured for SQL Server.

Well, it sets up all the schema in the SQL Server database except for a minor detail: No foreign keys are created.

The rake command doesn't show any errors and does say it is adding foreign keys. But they don't actually get added. This is the last bit from the command:

-- add_foreign_key("workhistoryform", "form", {:name=>"workhistoryform_form_rid_fkey", :column=>"form_rid", :primary_key=>"form_rid"})
   -> 0.0002s
-- initialize_schema_migrations_table()
   -> 0.0092s
-- assume_migrated_upto_version(0)
   -> 0.0942s
[earlz@earlzarch avp_msql_migrations]$

So what is the problem? Does the Foreigner plugin not work in SQL Server? If it didn't I'd expect to see an error or something...

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about foreigner