From c3188f024978f7070883dcbd9aa721f977b27c25 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 28 Jan 2020 15:01:30 +0000 Subject: [PATCH] Bug 24287: DBRev 19.12.00.014 Signed-off-by: Martin Renvoize --- Koha.pm | 2 +- Koha/Schema/Result/Branchtransfer.pm | 12 ++++++++++-- .../data/mysql/atomicupdate/bug_24287.perl | 18 ------------------ installer/data/mysql/updatedatabase.pl | 18 ++++++++++++++++++ 4 files changed, 29 insertions(+), 21 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_24287.perl diff --git a/Koha.pm b/Koha.pm index 2cfa23cfbc..a80840c9a4 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "19.12.00.013"; +$VERSION = "19.12.00.014"; sub version { return $VERSION; diff --git a/Koha/Schema/Result/Branchtransfer.pm b/Koha/Schema/Result/Branchtransfer.pm index 0e852e6e02..01409019a0 100644 --- a/Koha/Schema/Result/Branchtransfer.pm +++ b/Koha/Schema/Result/Branchtransfer.pm @@ -69,6 +69,12 @@ __PACKAGE__->table("branchtransfers"); data_type: 'longtext' is_nullable: 1 +=head2 reason + + data_type: 'enum' + extra: {list => ["Manual"]} + is_nullable: 1 + =cut __PACKAGE__->add_columns( @@ -111,6 +117,8 @@ __PACKAGE__->add_columns( }, "comments", { data_type => "longtext", is_nullable => 1 }, + "reason", + { data_type => "enum", extra => { list => ["Manual"] }, is_nullable => 1 }, ); =head1 PRIMARY KEY @@ -173,8 +181,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uPQzv0lMxfnu75SzS6UpVQ +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-01-28 15:01:05 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vN1IPDN+R7eqJ9BxMdlg4A sub koha_object_class { 'Koha::Item::Transfer'; diff --git a/installer/data/mysql/atomicupdate/bug_24287.perl b/installer/data/mysql/atomicupdate/bug_24287.perl deleted file mode 100644 index 7eb3eb65a7..0000000000 --- a/installer/data/mysql/atomicupdate/bug_24287.perl +++ /dev/null @@ -1,18 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - - unless ( column_exists('branchtransfers', 'reason') ) { - $dbh->do( - qq{ - ALTER TABLE branchtransfers - ADD - `reason` enum('Manual') - AFTER - comments - } - ); - } - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 24287 - Add 'reason' field to transfers table)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index cd170dbcb7..f4445437b7 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -20576,6 +20576,24 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 24478 - Add `EnablePointOfSale` system preference to allow disabling the point of sale feature)\n"; } +$DBversion = '19.12.00.014'; +if( CheckVersion( $DBversion ) ) { + unless ( column_exists('branchtransfers', 'reason') ) { + $dbh->do( + qq{ + ALTER TABLE branchtransfers + ADD + `reason` enum('Manual') + AFTER + comments + } + ); + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 24287 - Add 'reason' field to transfers table)\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; -- 2.39.5