package MyDatabase::Result::Cd; use strict; use warnings; use base qw/DBIx::Class::Core/; __PACKAGE__->table('cd'); __PACKAGE__->add_columns( cdid => { data_type => 'integer', is_auto_increment => 1, }, artist => { data_type => 'integer', is_nullable => 0, }, name => { data_type => 'text', is_nullable => 0, }, ); __PACKAGE__->set_primary_key('cdid'); __PACKAGE__->belongs_to( 'artist' => 'MyDatabase::Result::Artist' ); 1;