14
Ruby on Rails seems to have been thought of considering that it is not necessary to define constraints (as Foreign Keys) in the database, just define them via application.
Usually the only Constraint which is created in this case is the primary key of the column id
, otherwise only indexes (not necessarily unique) for performance reasons. I also don’t usually use NOT NULL
, for example.
In general this facilitates development, especially in the versioning of the database.
I have to worry about integrity risks and the like when working in this way (leaving everything to the application)?
This makes it easier for those who develop in Ruby, and when you develop a single application. It may seem like the last Coca-Cola in the desert right now, but if ever another application built on another platform (or even Ruby, without repurposing current logic) has to perform business operations on the same database, you just won’t call Mr. David Heinemeier Hansson of Saint.
– Oralista de Sistemas