X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=examples%2FSchema%2FMyApp%2FSchema%2FResult%2FCd.pm;h=d78874409a3b5f14e72036a26072974f5d49b2f4;hb=1f9ae1a378e692a83c39da3a1c2cab60bb4a5591;hp=9b0602c249100628cd88b569ec6e08f5a9735657;hpb=b7fcdab3af6f5a8a0cbef74c0680b26828a8cf2f;p=dbsrgits%2FDBIx-Class.git diff --git a/examples/Schema/MyApp/Schema/Result/Cd.pm b/examples/Schema/MyApp/Schema/Result/Cd.pm index 9b0602c..d788744 100644 --- a/examples/Schema/MyApp/Schema/Result/Cd.pm +++ b/examples/Schema/MyApp/Schema/Result/Cd.pm @@ -12,7 +12,7 @@ __PACKAGE__->add_columns( data_type => 'integer', is_auto_increment => 1 }, - artist => { + artistid => { data_type => 'integer', }, title => { @@ -26,9 +26,9 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key('cdid'); -__PACKAGE__->add_unique_constraint([qw( title artist )]); +__PACKAGE__->add_unique_constraint([qw( title artistid )]); -__PACKAGE__->belongs_to('artist' => 'MyApp::Schema::Result::Artist'); -__PACKAGE__->has_many('tracks' => 'MyApp::Schema::Result::Track'); +__PACKAGE__->belongs_to('artist' => 'MyApp::Schema::Result::Artist', 'artistid'); +__PACKAGE__->has_many('tracks' => 'MyApp::Schema::Result::Track', 'cdid'); 1;