c20aea3daeae1c86ce6a93f123c12ae45450cc2f
[dbsrgits/DBIx-Class-ResultSet-HashRef.git] / t / lib / TestSchema / Role.pm
1 package TestSchema::Role;
2
3 use strict;
4 use warnings;
5 use base qw( DBIx::Class );
6
7 __PACKAGE__->load_components(qw( Core ));
8 __PACKAGE__->table('role');
9 __PACKAGE__->add_columns(
10     id => {
11         data_type         => 'int',
12         is_auto_increment => 1,
13         is_nullable       => 0,
14         default_value     => undef,
15         size              => 10,
16     },
17     name => {
18         data_type   => 'varchar',
19         size        => 16,
20         is_nullable => 0,
21     },
22 );
23 __PACKAGE__->set_primary_key("id");
24 __PACKAGE__->has_many( user_role => 'TestSchema::UserRole', 'role_id' );
25 __PACKAGE__->many_to_many( users => 'user_role', 'user' );
26
27 1;