[Melbourne-pm] DBIx::Class join errors ...

Andrew Pam andrew at sericyb.com.au
Sun Mar 6 17:09:11 PST 2011


On 06/03/11 13:28, Malcolm Herbert wrote:
> I've created a Catalyst app using database schema classes as provided by
> DBIx::Class - I have a database with two tables:
> 
>   create table channel (
>     channel uuid not null primary key,
>     name text not null,
>     description text not null,
>     url text not null,
>   );
>   
>   create table show (
>     show uuid not null primary key,
>     channel uuid not null references channel,
>     name text not null,
>     description text not null,
>     url text,
>   );

I don't recommend having fields and tables with the same name.  That
leads to ambiguity and potential confusion, making code hard to
maintain.  One possible practice is to always name fields in the
singular and tables in the plural, so you could have "channels.channel"
and "shows.channel".

Hope that helps,
		Andrew


More information about the Melbourne-pm mailing list