Examples and documentation update and cleanup
[dbsrgits/DBIx-Class.git] / examples / Schema / MyApp / Schema / Result / Artist.pm
1 package MyApp::Schema::Result::Artist;
2
3 use warnings;
4 use strict;
5
6 use base qw( DBIx::Class::Core );
7
8 __PACKAGE__->table('artist');
9
10 __PACKAGE__->add_columns(
11   artistid => {
12     data_type => 'integer',
13     is_auto_increment => 1
14   },
15   name => {
16     data_type => 'text',
17   },
18 );
19
20 __PACKAGE__->set_primary_key('artistid');
21
22 __PACKAGE__->add_unique_constraint([qw( name )]);
23
24 __PACKAGE__->has_many('cds' => 'MyApp::Schema::Result::Cd', 'artistid');
25
26 1;
27