Re: calling 'has_a' on foreign key that is also a primary key causes intermittant error.

[prev] [thread] [next] [Date index for 2005/02/08]

From: Matt S Trout
Subject: Re: calling 'has_a' on foreign key that is also a primary key causes intermittant error.
Date: 12:45 on 08 Feb 2005
On Tue, Feb 08, 2005 at 10:35:27AM +0000, Chris Soanes wrote:
> Hi all, I have a problem, for which I have a workaround, but it's not 
> optimal, so I'm asking you guys for ideas.
> 
> I have a database with two tables (amongst others....)
> 
> table gateways:
> name         text    PRIMARY KEY,
> customer_id  integer REFERENCES customer_details,
> build_status char(2) NOT NULL.
> type         text    REFERENCES gateway_types
> 
> 
> table subscriber_gateways:
> name             text PRIMARY KEY REFERENCES gateways,
> mgcp_domain_name text UNIQUE

Wouldn't might_have be better for this?

        -- 
            Matt S Trout            Brag sheet:    http://trout.me.uk/services.html
LAMP, Infrastructure        Contact:       services@xxxxx.xx.xx
   and Automation
     specialist                                       Do it once. Do it right.

Re: calling 'has_a' on foreign key that is also a primary key causes intermittant error.
Matt S Trout 12:45 on 08 Feb 2005

Generated at 10:21 on 11 Feb 2005 by mariachi v0.52