From 7cfcfae3c4207a37a9b4b3836bd093a9376e51fa Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 9 Oct 2018 11:30:23 +0000 Subject: [PATCH] Bug 21417: DBRev 17.11.11.002 Signed-off-by: Nick Clemens (cherry picked from commit cf8890465d32d780e4177438d9b6ae807b1df36d) Signed-off-by: Martin Renvoize (cherry picked from commit 18d04888b2264ab85a24290c51eed01c051418ce) Signed-off-by: Fridolin Somers --- Koha.pm | 2 +- Koha/Schema/Result/EdifactEan.pm | 15 ++++++++++----- installer/data/mysql/atomicupdate/bug_21417.perl | 7 ------- installer/data/mysql/updatedatabase.pl | 7 +++++++ 4 files changed, 18 insertions(+), 13 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_21417.perl diff --git a/Koha.pm b/Koha.pm index 9d6b786376..219e0f15c6 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 = "17.11.11.001"; +$VERSION = "17.11.11.002"; sub version { return $VERSION; diff --git a/Koha/Schema/Result/EdifactEan.pm b/Koha/Schema/Result/EdifactEan.pm index 96dd729ab7..09fba9b32d 100644 --- a/Koha/Schema/Result/EdifactEan.pm +++ b/Koha/Schema/Result/EdifactEan.pm @@ -39,7 +39,7 @@ __PACKAGE__->table("edifact_ean"); data_type: 'varchar' is_foreign_key: 1 - is_nullable: 0 + is_nullable: 1 size: 10 =head2 ean @@ -63,7 +63,7 @@ __PACKAGE__->add_columns( "description", { data_type => "varchar", is_nullable => 1, size => 128 }, "branchcode", - { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 }, + { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, "ean", { data_type => "varchar", is_nullable => 0, size => 15 }, "id_code_qualifier", @@ -96,12 +96,17 @@ __PACKAGE__->belongs_to( "branchcode", "Koha::Schema::Result::Branch", { branchcode => "branchcode" }, - { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "RESTRICT", + on_update => "RESTRICT", + }, ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-03-11 12:04:29 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wziFbge4g2Ek1lc8Anto+Q +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-10-09 11:29:27 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9CSEvOmfmy52+QAYAgrybA # 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_21417.perl b/installer/data/mysql/atomicupdate/bug_21417.perl deleted file mode 100644 index 952e5b6bd3..0000000000 --- a/installer/data/mysql/atomicupdate/bug_21417.perl +++ /dev/null @@ -1,7 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - $dbh->do( "ALTER TABLE edifact_ean MODIFY branchcode VARCHAR(10) NULL DEFAULT NULL" ); - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug XXXXX - description)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 263f3739d3..bec3296aa8 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -15229,6 +15229,13 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 21617: Make statistics.ccode longer)\n"; } +$DBversion = '17.11.11.002'; +if( CheckVersion( $DBversion ) ) { + $dbh->do( "ALTER TABLE edifact_ean MODIFY branchcode VARCHAR(10) NULL DEFAULT NULL" ); + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 21417 - EDI ordering fails when basket and EAN libraries do not match)\n"; +} + # DEVELOPER PROCESS, search for anything to execute in the db_update directory # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5