Commit | Line | Data |
8d028daa |
1 | package TestSchema::UserRole; |
2 | |
3 | use strict; |
4 | use warnings; |
5 | use base qw( DBIx::Class ); |
6 | |
7 | __PACKAGE__->load_components("Core"); |
8 | __PACKAGE__->table("user_role"); |
9 | __PACKAGE__->add_columns( |
10 | user_id => { |
11 | data_type => "INT", |
12 | default_value => undef, |
13 | is_nullable => 0, |
14 | size => 10 |
15 | }, |
16 | role_id => { |
17 | data_type => "INT", |
18 | default_value => undef, |
19 | is_nullable => 0, |
20 | size => 10 |
21 | }, |
22 | ); |
23 | __PACKAGE__->set_primary_key(qw/user_id role_id/); |
24 | __PACKAGE__->belongs_to( user => 'TestSchema::User', { id => "user_id" } ); |
25 | __PACKAGE__->belongs_to( role => 'TestSchema::Role', { id => "role_id" } ); |