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