Commit | Line | Data |
---|---|---|
527b7d89 | 1 | package DBICTest::Schema::Genre; |
2 | ||
4a233f30 | 3 | use warnings; |
527b7d89 | 4 | use strict; |
5 | ||
660cf1be | 6 | use base qw/DBICTest::BaseResult/; |
527b7d89 | 7 | |
8 | __PACKAGE__->table('genre'); | |
87310237 | 9 | __PACKAGE__->add_columns( |
10 | genreid => { | |
11 | data_type => 'integer', | |
12 | is_auto_increment => 1, | |
13 | }, | |
14 | name => { | |
15 | data_type => 'varchar', | |
16 | size => 100, | |
17 | }, | |
18 | ); | |
527b7d89 | 19 | __PACKAGE__->set_primary_key('genreid'); |
87310237 | 20 | __PACKAGE__->add_unique_constraint ( genre_name => [qw/name/] ); |
527b7d89 | 21 | |
87310237 | 22 | __PACKAGE__->has_many (cds => 'DBICTest::Schema::CD', 'genreid'); |
527b7d89 | 23 | |
2284af7e | 24 | __PACKAGE__->has_one (model_cd => 'DBICTest::Schema::CD', 'genreid'); |
25 | ||
527b7d89 | 26 | 1; |