ruby on rails - Prevent rake migrate from creating foreign key constraint -


we have case in 1 of table column name use suffix "_id". migration code :

create_table :companies |t|   t.integer :ref_id     t.string :name end 

when running db:migrate, fails, because rails tried create foreign key constraint ref_id, , found there no table called "refs". in our case "ref_id" not foreign key.

is there way prevent rails create foreign key constraint column?

it seems have schema_plus gem. can do:

create_table :companies |t|   t.integer :ref_id, foreign_key: false     t.string :name end  

Popular posts from this blog

javascript - Js, document.getElementById("ID").innerHTML, error -

jquery - jqGrid update specific column data with out refreshing the entire column? -

objective c - Is there a way in OCMockito to make stubs fail when an unknown method is called? -