Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Lack of foreign-key constraints support in ActiveRecord
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Rodrigo Rosenfeld Rosas  
View profile  
 More options Dec 2 2011, 10:26 am
From: Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com>
Date: Fri, 02 Dec 2011 13:26:28 -0200
Local: Fri, Dec 2 2011 10:26 am
Subject: Re: [Rails-core] Lack of foreign-key constraints support in ActiveRecord
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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.