Update example Result classes for proper DDL generation
[dbsrgits/DBIx-Class.git] / examples / Schema / MyApp / Schema / Result / Artist.pm
CommitLineData
a5bd5d88 1package MyApp::Schema::Result::Artist;
d88ecca6 2
3use warnings;
4use strict;
5
20bfea3f 6use base qw( DBIx::Class::Core );
d88ecca6 7
0c337847 8__PACKAGE__->table('artist');
d88ecca6 9
20bfea3f 10__PACKAGE__->add_columns(
11 artistid => {
12 data_type => 'integer',
13 is_auto_increment => 1
14 },
15 name => {
16 data_type => 'text',
17 },
18);
d88ecca6 19
0c337847 20__PACKAGE__->set_primary_key('artistid');
d88ecca6 21
20bfea3f 22__PACKAGE__->add_unique_constraint([qw( name )]);
23
a5bd5d88 24__PACKAGE__->has_many('cds' => 'MyApp::Schema::Result::Cd');
0c337847 25
261;
27