lib/App/DrivePlayer/Schema/Result/Folder.pm

filter: Statementstmt 100% 18 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 95.6% 22 / 23 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« lib/App/DrivePlayer/Schema.pm ↑ Summary lib/App/DrivePlayer/Schema/Result/Track.pm »
1 package App::DrivePlayer::Schema::Result::Folder;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use base 'DBIx::Class::Core';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 __PACKAGE__->table('folders');
8  
9 2 __PACKAGE__->add_columns(
10 id => {
11 data_type => 'integer',
12 is_auto_increment => 1,
13 is_nullable => 0,
14 },
15 drive_id => {
16 data_type => 'text',
17 is_nullable => 0,
18 },
19 name => {
20 data_type => 'text',
21 is_nullable => 0,
22 },
23 parent_drive_id => {
24 data_type => 'text',
25 is_nullable => 1,
26 },
27 path => {
28 data_type => 'text',
29 is_nullable => 0,
30 },
31 scan_folder_id => {
32 data_type => 'integer',
33 is_nullable => 1,
34 is_foreign_key => 1,
35 },
36 );
37  
38 2 __PACKAGE__->set_primary_key('id');
39 2 __PACKAGE__->add_unique_constraint( unique_drive_id => ['drive_id'] );
40  
41 2 __PACKAGE__->belongs_to(
42 scan_folder => 'App::DrivePlayer::Schema::Result::ScanFolder',
43 'scan_folder_id',
44 );
45  
46 2 __PACKAGE__->has_many(
47 tracks => 'App::DrivePlayer::Schema::Result::Track',
48 'folder_id',
49 { cascade_delete => 1 },
50 );
51  
52 35 ▶sub sqlt_deploy_hook {
Subroutine sqlt_deploy_hook: called CC=1 SCAR=0.0
Pod undocumented
53 35 my ($self, $sqlt_table) = @_;
54 35 $sqlt_table->add_index( name => 'idx_folders_scan_folder', fields => ['scan_folder_id'] );
55 }
56  
57 2 1;
58  
59 __END__
« lib/App/DrivePlayer/Schema.pm ↑ Summary lib/App/DrivePlayer/Schema/Result/Track.pm »