Foreign keys in Rails 3

后端 未结 3 1823
离开以前
离开以前 2021-02-08 08:17

I understand that according to Rails philosophy, data integrity checks should be done at the application level as opposed to the database level. Like many other developers, I en

3条回答
  •  长发绾君心
    2021-02-08 08:58

    http://guides.rubyonrails.org/migrations.html#active-record-and-referential-integrity

    "Although Active Record does not provide any tools for working directly with such features, the execute method can be used to execute arbitrary SQL. There are also a number of plugins such as foreign_key_migrations which add foreign key support to Active Record."

提交回复
热议问题