|
Lines 1-5
Link Here
|
| 1 |
use Modern::Perl; |
1 |
use Modern::Perl; |
| 2 |
use Koha::Installer::Output qw(say_warning say_failure say_success say_info); |
2 |
use Koha::Installer::Output qw(say_warning say_success say_info); |
| 3 |
|
3 |
|
| 4 |
return { |
4 |
return { |
| 5 |
bug_number => '37592', |
5 |
bug_number => '37592', |
|
Lines 31-47
return {
Link Here
|
| 31 |
ALTER TABLE bookings ADD COLUMN modification_date DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'The datetime for when a booking has been updated' |
31 |
ALTER TABLE bookings ADD COLUMN modification_date DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'The datetime for when a booking has been updated' |
| 32 |
SQL |
32 |
SQL |
| 33 |
if ( @{$existing_columns} == 0 ) { |
33 |
if ( @{$existing_columns} == 0 ) { |
| 34 |
if ( $dbh->do("$creation_date_statement AFTER `end_date`") ) { |
34 |
$dbh->do("$creation_date_statement AFTER `end_date`"); |
| 35 |
say_success( $out, q{Added column 'bookings.creation_date'} ); |
35 |
say_success( $out, q{Added column 'bookings.creation_date'} ); |
| 36 |
} else { |
|
|
| 37 |
say_failure( $out, q{Failed to add column 'bookings.creation_date': } . $dbh->errstr ); |
| 38 |
} |
| 39 |
|
36 |
|
| 40 |
if ( $dbh->do("$modification_date_statement AFTER `creation_date`") ) { |
37 |
$dbh->do("$modification_date_statement AFTER `creation_date`"); |
| 41 |
say_success( $out, q{Added column 'bookings.modification_date'} ); |
38 |
say_success( $out, q{Added column 'bookings.modification_date'} ); |
| 42 |
} else { |
|
|
| 43 |
say_failure( $out, q{Failed to add column 'bookings.modification_date': } . $dbh->errstr ); |
| 44 |
} |
| 45 |
|
39 |
|
| 46 |
return; |
40 |
return; |
| 47 |
} |
41 |
} |
|
Lines 61-71
return {
Link Here
|
| 61 |
$statement = "$modification_date_statement AFTER `creation_date`"; |
55 |
$statement = "$modification_date_statement AFTER `creation_date`"; |
| 62 |
} |
56 |
} |
| 63 |
|
57 |
|
| 64 |
if ( $dbh->do($statement) ) { |
58 |
$dbh->do($statement); |
| 65 |
say_success( $out, "Added column 'bookings.$column'" ); |
59 |
say_success( $out, "Added column 'bookings.$column'" ); |
| 66 |
} else { |
|
|
| 67 |
say_failure( $out, "Failed to add column 'bookings.$column': " . $dbh->errstr ); |
| 68 |
} |
| 69 |
} |
60 |
} |
| 70 |
} |
61 |
} |
| 71 |
}, |
62 |
}, |