Force on_delete/on_update arguments to upper case for consistency with the rest of...
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / CD.pm
CommitLineData
c6d74d3e 1package # hide from PAUSE
2 DBICTest::Schema::CD;
a02675cd 3
4use base 'DBIx::Class::Core';
5
ff657a43 6__PACKAGE__->table('cd');
7__PACKAGE__->add_columns(
0009fa49 8 'cdid' => {
9 data_type => 'integer',
10 is_auto_increment => 1,
11 },
12 'artist' => {
13 data_type => 'integer',
14 },
15 'title' => {
16 data_type => 'varchar',
cb561d1a 17 size => 100,
0009fa49 18 },
19 'year' => {
20 data_type => 'varchar',
cb561d1a 21 size => 100,
0009fa49 22 },
23);
ff657a43 24__PACKAGE__->set_primary_key('cdid');
368a5228 25__PACKAGE__->add_unique_constraint([ qw/artist title/ ]);
ff657a43 26
e377d723 27__PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist', undef, {
28 is_deferrable => 1,
29 on_delete => undef,
30 on_update => 'SET NULL',
31});
ff657a43 32
33__PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track' );
34__PACKAGE__->has_many(
35 tags => 'DBICTest::Schema::Tag', undef,
36 { order_by => 'tag' },
37);
38__PACKAGE__->has_many(
39 cd_to_producer => 'DBICTest::Schema::CD_to_Producer' => 'cd'
40);
41
42__PACKAGE__->might_have(
43 liner_notes => 'DBICTest::Schema::LinerNotes', undef,
44 { proxy => [ qw/notes/ ] },
45);
46__PACKAGE__->many_to_many( producers => cd_to_producer => 'producer' );
47__PACKAGE__->many_to_many(
48 producers_sorted => cd_to_producer => 'producer',
49 { order_by => 'producer.name' },
50);
a02675cd 51
521;