File Coverage

blib/lib/AproJo/DB/Schema/Result/Group.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::Group;
2              
3 2     2   793 use strict;
  2         3  
  2         54  
4 2     2   7 use warnings;
  2         2  
  2         43  
5              
6 2     2   7 use base 'DBIx::Class::Core';
  2         2  
  2         247  
7              
8             __PACKAGE__->table('groups');
9              
10             __PACKAGE__->add_columns(
11             'group_id',
12             {data_type => 'integer', is_auto_increment => 1, is_nullable => 0},
13             'name',
14             {data_type => 'varchar', is_nullable => 0, size => 160},
15             'trash',
16             {data_type => 'tinyint', default_value => 0, is_nullable => 0},
17             );
18              
19             __PACKAGE__->set_primary_key('group_id');
20              
21             __PACKAGE__->has_many(
22             'user_groups',
23             'AproJo::DB::Schema::Result::UserGroup',
24             {'foreign.group_id' => 'self.group_id'},
25             {cascade_copy => 0, cascade_delete => 0},
26             );
27              
28             __PACKAGE__->many_to_many('user_ids', 'user_groups', 'user_id');
29              
30             1;