data_type => 'varchar',
size => 100,
},
+ 'genreid' => {
+ data_type => 'integer',
+ is_nullable => 1,
+ }
);
__PACKAGE__->set_primary_key('cdid');
-__PACKAGE__->add_unique_constraint(artist_title => [ qw/artist title/ ]);
+__PACKAGE__->add_unique_constraint([ qw/artist title/ ]);
-__PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist' );
+__PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist', undef, {
+ is_deferrable => 1,
+ on_delete => undef,
+ on_update => 'SET NULL',
+});
__PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track' );
__PACKAGE__->has_many(
{ order_by => 'producer.name' },
);
+__PACKAGE__->belongs_to('genre', 'DBICTest::Schema::Genre', { 'foreign.genreid' => 'self.genreid' });
+
+#__PACKAGE__->add_relationship('genre', 'DBICTest::Schema::Genre',
+# { 'foreign.genreid' => 'self.genreid' },
+# { 'accessor' => 'single' }
+#);
+
1;