[Catalyst] Loader and circular references

Zbyszek Lukasiak zby at zby.aster.net.pl
Sat Jul 2 09:00:21 CEST 2005


Dear all,

I have circular foreign key references in my tables.  I attache the DDL for
those tables below.  When I start catalyst I get lots of warning of the
format:
jobs method already exists in LinkDB::M::CDBI::Opinion
 at /usr/local/share/perl/5.8.4/Class/DBI/Relationship/HasMany.pm line 13
links method already exists in LinkDB::M::CDBI::Usr
 at /usr/local/share/perl/5.8.4/Class/DBI/Relationship/HasMany.pm line 13
opinions method already exists in LinkDB::M::CDBI::Link
 at /usr/local/share/perl/5.8.4/Class/DBI/Relationship/HasMany.pm line 13
opinions method already exists in LinkDB::M::CDBI::Usr
...

I am not sure if the circular foreign keys don't break some Relational 
Database best practices, but still this seems like a bug in the Loader. 

-- Zbigniew Lukasiak

=========================================
create table job(
id serial primary key,
cdate timestamp default CURRENT_TIMESTAMP,
addtags text,
startopinion integer,
maxdistance integer
);

create table opinion(
id serial primary key,
link integer,
usr integer,
name text,
flag char (1),
cdate timestamp,
namevect tsvector,
tags text,
tagsvect tsvector,
origin char(1),
distance integer,
job integer,
foreign key (job) references job(id) ON DELETE CASCADE,
foreign key (link) references link(id) ON DELETE CASCADE,
foreign key (usr) references usr(id) ON DELETE CASCADE
);
alter table job add foreign key(startopinion) references opinion(id) on delete cascade;





More information about the Catalyst mailing list