Lines 1-27
Link Here
|
1 |
use Modern::Perl; |
1 |
use Modern::Perl; |
2 |
return { |
2 |
return { |
3 |
bug_number => "16122", |
3 |
bug_number => "16122", |
4 |
description => "Add localuser column to items table", |
4 |
description => "Add local use column to items table", |
5 |
up => sub { |
5 |
up => sub { |
6 |
my ($args) = @_; |
6 |
my ($args) = @_; |
7 |
my ($dbh, $out) = @$args{qw(dbh out)}; |
7 |
my ( $dbh, $out ) = @$args{qw(dbh out)}; |
8 |
if( !column_exists( 'items', 'localuse' ) ) { |
8 |
if ( !column_exists( 'items', 'localuse' ) ) { |
9 |
$dbh->do(q{ |
9 |
$dbh->do( |
|
|
10 |
q{ |
10 |
ALTER TABLE items |
11 |
ALTER TABLE items |
11 |
ADD COLUMN localuse smallint(6) NULL DEFAULT NULL |
12 |
ADD COLUMN localuse smallint(6) NULL DEFAULT NULL |
12 |
COMMENT "item's local use count" |
13 |
COMMENT "number of times this item has been recorded as local use" |
13 |
AFTER renewals |
14 |
AFTER renewals |
14 |
}); |
15 |
} |
|
|
16 |
); |
15 |
say $out "Added column 'items.localuse'"; |
17 |
say $out "Added column 'items.localuse'"; |
16 |
} |
18 |
} |
17 |
if( !column_exists( 'deleteditems', 'localuse' ) ) { |
19 |
if ( !column_exists( 'deleteditems', 'localuse' ) ) { |
18 |
$dbh->do(q{ |
20 |
$dbh->do( |
|
|
21 |
q{ |
19 |
ALTER TABLE deleteditems |
22 |
ALTER TABLE deleteditems |
20 |
ADD COLUMN localuse smallint(6) NULL DEFAULT NULL |
23 |
ADD COLUMN localuse smallint(6) NULL DEFAULT NULL |
21 |
COMMENT "deleteditems local use count" |
24 |
COMMENT "number of times this item has been recorded as local use" |
22 |
AFTER renewals |
25 |
AFTER renewals |
23 |
}); |
26 |
} |
|
|
27 |
); |
24 |
say $out "Added column 'deleteditems.localuse'"; |
28 |
say $out "Added column 'deleteditems.localuse'"; |
25 |
} |
29 |
} |
26 |
}, |
30 |
}, |
27 |
} |
31 |
} |