Comment by Lio
3 days ago
Rails fully supports constraints and encourages you to use them.
You can either execute SQL in your migration or use add_check_constraint.
3 days ago
Rails fully supports constraints and encourages you to use them.
You can either execute SQL in your migration or use add_check_constraint.
Back when I used Rails the sentiment was: You don't need foreign keys, this is all handled by ActiveRecord.
I’m guessing that must have been the 00s then. I haven’t seen anyone downplay database constraints for a very long time.