Lines 21-35
return {
Link Here
|
21 |
} |
21 |
} |
22 |
); |
22 |
); |
23 |
|
23 |
|
24 |
my @indexes = ( 0 .. 6 ); |
24 |
my $branches = |
25 |
for my $i (@indexes) { |
25 |
$dbh->selectall_arrayref( "SELECT branchcode FROM branches", { Slice => {} } ); |
26 |
$dbh->do( |
26 |
for my $branch (@$branches) { |
27 |
q{ INSERT INTO library_hours (library_id, day) SELECT branchcode, ? FROM branches }, undef, |
27 |
my $branchcode = $branch->{branchcode}; |
28 |
$i |
28 |
|
29 |
); |
29 |
my @indexes = ( 0 .. 6 ); |
|
|
30 |
for my $i (@indexes) { |
31 |
$dbh->do( q{ INSERT INTO library_hours (library_id, day) VALUES ( ?, ? ) }, undef, $branchcode, $i ); |
32 |
} |
30 |
} |
33 |
} |
31 |
|
34 |
|
32 |
say $out "Added table `library_hours`"; |
35 |
say $out "Added table `library_hours`"; |
|
|
36 |
|
37 |
$dbh->do( |
38 |
q{ INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type ) VALUES ( 'ConsiderLibraryHoursInCirculation', 'ignore', 'close|open|ignore', "Take library opening hours into consideration to calculate due date when circulating.", 'Choice' ) } |
39 |
); |
40 |
|
41 |
say $out "Added system preference 'ConsiderLibraryHoursInCirculation'"; |
33 |
} |
42 |
} |
34 |
}, |
43 |
}, |
35 |
}; |
44 |
}; |
36 |
- |
|
|