|
Line 0
Link Here
|
| 0 |
- |
1 |
use Modern::Perl; |
|
|
2 |
use Koha::Installer::Output qw(say_warning say_failure say_success say_info); |
| 3 |
|
| 4 |
return { |
| 5 |
bug_number => "33641", |
| 6 |
description => "Added issues.return_branch and old_issues.return_branch", |
| 7 |
up => sub { |
| 8 |
my ($args) = @_; |
| 9 |
my ( $dbh, $out ) = @$args{qw(dbh out)}; |
| 10 |
|
| 11 |
if ( !column_exists( 'issues', 'return_branch' ) ) { |
| 12 |
$dbh->do( |
| 13 |
q{ |
| 14 |
ALTER TABLE issues |
| 15 |
ADD COLUMN return_branch varchar(10) DEFAULT NULL |
| 16 |
COMMENT 'foreign key, linking to the branches table for the location the item was returned' |
| 17 |
AFTER returndate |
| 18 |
} |
| 19 |
); |
| 20 |
say_success( $out, "Added column 'issues.return_branch'" ); |
| 21 |
} |
| 22 |
if ( !column_exists( 'old_issues', 'return_branch' ) ) { |
| 23 |
$dbh->do( |
| 24 |
q{ |
| 25 |
ALTER TABLE old_issues |
| 26 |
ADD COLUMN return_branch varchar(10) DEFAULT NULL |
| 27 |
COMMENT 'foreign key, linking to the branches table for the location the item was returned' |
| 28 |
AFTER returndate |
| 29 |
} |
| 30 |
); |
| 31 |
say_success( $out, "Added column 'old_issues.return_branch'" ); |
| 32 |
} |
| 33 |
|
| 34 |
}, |
| 35 |
}; |