Commit | Line | Data |
---|---|---|
a5bd5d88 | 1 | package MyApp::Schema::Result::Track; |
d88ecca6 | 2 | |
3 | use warnings; | |
4 | use strict; | |
5 | ||
20bfea3f | 6 | use base qw( DBIx::Class::Core ); |
d88ecca6 | 7 | |
0c337847 | 8 | __PACKAGE__->table('track'); |
d88ecca6 | 9 | |
20bfea3f | 10 | __PACKAGE__->add_columns( |
11 | trackid => { | |
12 | data_type => 'integer', | |
13 | is_auto_increment => 1 | |
14 | }, | |
1f9ae1a3 | 15 | cdid => { |
20bfea3f | 16 | data_type => 'integer', |
17 | }, | |
18 | title => { | |
19 | data_type => 'text', | |
20 | }, | |
21 | ); | |
d88ecca6 | 22 | |
0c337847 | 23 | __PACKAGE__->set_primary_key('trackid'); |
d88ecca6 | 24 | |
1f9ae1a3 | 25 | __PACKAGE__->add_unique_constraint([qw( title cdid )]); |
20bfea3f | 26 | |
1f9ae1a3 | 27 | __PACKAGE__->belongs_to('cd' => 'MyApp::Schema::Result::Cd', 'cdid'); |
0c337847 | 28 | |
29 | 1; |