From f190ef3f2e7b7a03c3ca10086ed3a923b7c11bdb Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 6 Sep 2018 16:52:59 +0000 Subject: [PATCH] Bug 7534: DBRev 18.06.00.024 Signed-off-by: Nick Clemens --- Koha.pm | 2 +- Koha/Schema/Result/Branch.pm | 12 ++++++++++-- installer/data/mysql/atomicupdate/bug_7534.perl | 7 ------- installer/data/mysql/updatedatabase.pl | 9 +++++++++ 4 files changed, 20 insertions(+), 10 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_7534.perl diff --git a/Koha.pm b/Koha.pm index 9c8a0db287..23404400e6 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 = "18.06.00.023"; +$VERSION = "18.06.00.024"; sub version { return $VERSION; diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm index bb571b18de..b85094bdbf 100644 --- a/Koha/Schema/Result/Branch.pm +++ b/Koha/Schema/Result/Branch.pm @@ -140,6 +140,12 @@ __PACKAGE__->table("branches"); is_nullable: 1 size: 16 +=head2 pickup_location + + data_type: 'tinyint' + default_value: 1 + is_nullable: 0 + =cut __PACKAGE__->add_columns( @@ -187,6 +193,8 @@ __PACKAGE__->add_columns( { data_type => "varchar", is_nullable => 1, size => 255 }, "marcorgcode", { data_type => "varchar", is_nullable => 1, size => 16 }, + "pickup_location", + { data_type => "tinyint", default_value => 1, is_nullable => 0 }, ); =head1 PRIMARY KEY @@ -609,8 +617,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QOMUFz2EjvAVWCkIpNmvtg +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-09-06 16:28:49 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:N0tdcSAb4bMht/i0chipYQ # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/installer/data/mysql/atomicupdate/bug_7534.perl b/installer/data/mysql/atomicupdate/bug_7534.perl deleted file mode 100644 index 0cf94c800c..0000000000 --- a/installer/data/mysql/atomicupdate/bug_7534.perl +++ /dev/null @@ -1,7 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - $dbh->do( "ALTER TABLE branches ADD COLUMN pickup_location TINYINT(1) not null default 1" ); - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 7534 - Let libraries have configuration for pickup locations)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 260013fbbe..0287596598 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -16349,6 +16349,15 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 18639 - Add replacementprice field to aqorders table)\n"; } +$DBversion = '18.06.00.024'; +if( CheckVersion( $DBversion ) ) { + if( !column_exists( 'branches', 'pickup_location' ) ){ + $dbh->do( "ALTER TABLE branches ADD COLUMN pickup_location TINYINT(1) not null default 1" ); + } + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 7534 - Let libraries have configuration for pickup locations)\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5