File Coverage

blib/lib/AproJo/DB/Schema/Result/UserRole.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package AproJo::DB::Schema::Result::UserRole;
2              
3 2     2   1400 use strict;
  2         4  
  2         72  
4 2     2   11 use warnings;
  2         3  
  2         62  
5              
6 2     2   10 use base 'DBIx::Class::Core';
  2         4  
  2         429  
7              
8             __PACKAGE__->table('users_roles');
9              
10             __PACKAGE__->add_columns(
11             'user_id',
12             {data_type => 'integer', is_nullable => 0, is_foreign_key => 1},
13             'role_id',
14             {data_type => 'integer', is_nullable => 0, is_foreign_key => 1},
15              
16             );
17              
18             __PACKAGE__->set_primary_key('user_id', 'role_id');
19              
20             __PACKAGE__->belongs_to(
21             'role_id',
22             'AproJo::DB::Schema::Result::Role',
23             {role_id => 'role_id'},
24             {is_deferrable => 1, on_delete => 'CASCADE', on_update => 'CASCADE'},
25             );
26              
27             __PACKAGE__->belongs_to(
28             'user_id',
29             'AproJo::DB::Schema::Result::User',
30             {user_id => 'user_id'},
31             {is_deferrable => 1, on_delete => 'CASCADE', on_update => 'CASCADE'},
32             );
33              
34             1;