|
Lines 8-32
return {
Link Here
|
| 8 |
my ($args) = @_; |
8 |
my ($args) = @_; |
| 9 |
my ( $dbh, $out ) = @$args{qw(dbh out)}; |
9 |
my ( $dbh, $out ) = @$args{qw(dbh out)}; |
| 10 |
|
10 |
|
| 11 |
$dbh->do( |
11 |
my $col_type_borrowers = $dbh->selectrow_array( |
| 12 |
q{ |
12 |
q{ |
| 13 |
ALTER TABLE borrowers |
13 |
SELECT COLUMN_TYPE |
| 14 |
MODIFY COLUMN `checkprevcheckout` enum('yes', 'no', 'inherit') NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to category setting if ''inherit''.' |
14 |
FROM INFORMATION_SCHEMA.COLUMNS |
| 15 |
} |
15 |
WHERE TABLE_SCHEMA = DATABASE() |
|
|
16 |
AND TABLE_NAME = 'borrowers' |
| 17 |
AND COLUMN_NAME = 'checkprevcheckout' |
| 18 |
} |
| 16 |
); |
19 |
); |
| 17 |
|
20 |
|
| 18 |
$dbh->do( |
21 |
if ( $col_type_borrowers ne "enum('yes','no','inherit')" ) { |
| 19 |
q{ |
22 |
$dbh->do( |
| 20 |
ALTER TABLE categories |
23 |
q{ |
| 21 |
MODIFY COLUMN `checkprevcheckout` enum('yes', 'no', 'inherit') NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron category if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to syspref setting if ''inherit''.' |
24 |
ALTER TABLE borrowers |
|
|
25 |
MODIFY COLUMN `checkprevcheckout` enum('yes', 'no', 'inherit') NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to category setting if ''inherit''.' |
| 26 |
} |
| 27 |
); |
| 22 |
} |
28 |
} |
| 23 |
); |
|
|
| 24 |
|
29 |
|
| 25 |
$dbh->do( |
30 |
my $col_type_categories = $dbh->selectrow_array( |
| 26 |
q{ |
31 |
q{ |
| 27 |
ALTER TABLE deletedborrowers |
32 |
SELECT COLUMN_TYPE |
| 28 |
MODIFY COLUMN `checkprevcheckout` enum('yes', 'no', 'inherit') NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to category setting if ''inherit''.' |
33 |
FROM INFORMATION_SCHEMA.COLUMNS |
|
|
34 |
WHERE TABLE_SCHEMA = DATABASE() |
| 35 |
AND TABLE_NAME = 'categories' |
| 36 |
AND COLUMN_NAME = 'checkprevcheckout' |
| 37 |
} |
| 38 |
); |
| 39 |
|
| 40 |
if ( $col_type_categories ne "enum('yes','no','inherit')" ) { |
| 41 |
|
| 42 |
$dbh->do( |
| 43 |
q{ |
| 44 |
ALTER TABLE categories |
| 45 |
MODIFY COLUMN `checkprevcheckout` enum('yes', 'no', 'inherit') NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron category if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to syspref setting if ''inherit''.' |
| 46 |
} |
| 47 |
); |
| 29 |
} |
48 |
} |
|
|
49 |
|
| 50 |
my $col_type_deletedborrowers = $dbh->selectrow_array( |
| 51 |
q{ |
| 52 |
SELECT COLUMN_TYPE |
| 53 |
FROM INFORMATION_SCHEMA.COLUMNS |
| 54 |
WHERE TABLE_SCHEMA = DATABASE() |
| 55 |
AND TABLE_NAME = 'deletedborrowers' |
| 56 |
AND COLUMN_NAME = 'checkprevcheckout' |
| 57 |
} |
| 30 |
); |
58 |
); |
|
|
59 |
|
| 60 |
if ( $col_type_deletedborrowers ne "enum('yes','no','inherit')" ) { |
| 61 |
$dbh->do( |
| 62 |
q{ |
| 63 |
ALTER TABLE deletedborrowers |
| 64 |
MODIFY COLUMN `checkprevcheckout` enum('yes', 'no', 'inherit') NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to category setting if ''inherit''.' |
| 65 |
} |
| 66 |
); |
| 67 |
} |
| 31 |
}, |
68 |
}, |
| 32 |
}; |
69 |
}; |
| 33 |
- |
|
|