[Dbix-class] foreigns keys, joins, am I doing something stupid?
Chisel Wright
chisel at herlpacker.co.uk
Thu Jan 12 16:42:40 CET 2006
On Thu, Jan 12, 2006 at 11:12:48AM +0000, Chisel Wright wrote:
> ---------------------------------------------------------------------------
>
> CREATE TABLE artist (
> artistid integer NOT NULL,
> name character varying
> );
>
> CREATE TABLE cd (
> cdid integer NOT NULL,
> artist integer NOT NULL,
> title character varying,
> "year" character varying
> );
>
Some bad copying and pasting from a pg_dump on my part, both the id
columns are infact primary keys in my database:
CREATE TABLE artist (
artistid integer primary key,
name character varying
);
CREATE TABLE cd (
cdid integer primary key,
artist integer NOT NULL references artist,
title character varying,
"year" character varying
);
--
Chisel Wright
e: chisel at herlpacker.co.uk
w: http://www.herlpacker.co.uk/
This is not an automated signature. I type this in to the bottom of every
message.
More information about the Dbix-class
mailing list