[Dbix-class] is_foreign_key_constraint => false is ineffective

Matt S Trout dbix-class at trout.me.uk
Sat Nov 3 20:52:45 GMT 2007


On Fri, Nov 02, 2007 at 04:35:14PM +1030, Jon Schutz wrote:
> I've added is_foreign_key_constraint => 0 as an attribute in a
> relationship, in order to query across the join without imposing
> database level constraints - but the constraint is still appearing in
> the resulting schema.

Use an explicit join condition and wrap it in [] to stop FK creation -

__PACKAGE__->belongs_to(
  'foo', 'Schema::Foo', [ { 'foreign.id' => 'self.foo_id' } ]
);

Alternatively, could you update your patch to provide a relationship
attribute rather than a column attr? A column attr doesn't really make much
sense for multi-col FKs ...

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the DBIx-Class mailing list