Em 02-12-2011 12:47, James B. Byrne escreveu:
On Fri, December 2, 2011 06:32, Rodrigo Rosenfeld Rosas
wrote:
Em 01-12-2011 23:28, matthuhiggins escreveu:
it should be noted that the update I offered has zero
effect on those not using foreign keys. It's also worth
suggesting that the initial version can start with no
cascading options, so that all application logic is
kept in the application, and the foreign keys
act as a neutral constraint similar to NOT NULL.
I don't think this is right. A foreign key could be null.
If you don't want it to be null you should be explicit
about it
I do not think that is what the OP means.  I believe that
he is trying to say that implementing a non-cascading Fk
at the DBMS level can be considered a 'backstop' to any
application logic in (or missing from) the model.  This
may be considered similar to how the NOT NULL constraint
at the DBMS level is presently used inside AR.  It just
catches logic errors before they hit the DB.

Sure James, sorry about that. I should have read it more carefully.

And I also think that we should be explicit about cascading too while declaring a "reference" type in the migrations.

Even in the database level, cascading (null or delete) should not be considered the default for foreign keys since this is very specific to the use case.

--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to