|
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( |
| 32 |
q{ INSERT INTO library_hours (library_id, day) VALUES ( ?, ? ) }, undef, $branchcode, |
| 33 |
$i |
| 34 |
); |
| 35 |
} |
| 30 |
} |
36 |
} |
| 31 |
|
37 |
|
| 32 |
say $out "Added table `library_hours`"; |
38 |
say $out "Added table `library_hours`"; |
|
|
39 |
|
| 40 |
$dbh->do( |
| 41 |
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' ) } |
| 42 |
); |
| 43 |
|
| 44 |
say $out "Added system preference 'ConsiderLibraryHoursInCirculation'"; |
| 33 |
} |
45 |
} |
| 34 |
}, |
46 |
}, |
| 35 |
}; |
47 |
}; |
| 36 |
- |
|
|