From 41ef01098434aaa59b44368ac6b147b7d91939e1 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 25 Apr 2019 10:09:09 +0000 Subject: [PATCH] Bug 22729: DBRev 18.12.00.061 Signed-off-by: Nick Clemens --- Koha.pm | 2 +- Koha/Schema/Result/Borrower.pm | 18 +++++-------- Koha/Schema/Result/Deletedborrower.pm | 18 +++++-------- .../atomicupdate/bug_21336_followup.perl | 26 ------------------ installer/data/mysql/updatedatabase.pl | 27 +++++++++++++++++++ 5 files changed, 40 insertions(+), 51 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_21336_followup.perl diff --git a/Koha.pm b/Koha.pm index 4e0eac201f..153229dba5 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.12.00.060"; +$VERSION = "18.12.00.061"; sub version { return $VERSION; diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index f626ca9e18..0bc8b50849 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -451,12 +451,11 @@ __PACKAGE__->table("borrowers"); data_type: 'mediumtext' is_nullable: 1 -=head2 flgAnonymized +=head2 anonymized - accessor: 'flg_anonymized' data_type: 'tinyint' default_value: 0 - is_nullable: 1 + is_nullable: 0 =cut @@ -660,13 +659,8 @@ __PACKAGE__->add_columns( { data_type => "integer", default_value => 0, is_nullable => 1 }, "overdrive_auth_token", { data_type => "mediumtext", is_nullable => 1 }, - "flgAnonymized", - { - accessor => "flg_anonymized", - data_type => "tinyint", - default_value => 0, - is_nullable => 1, - }, + "anonymized", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, ); =head1 PRIMARY KEY @@ -1535,8 +1529,8 @@ Composing rels: L -> ordernumber __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber"); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-17 11:11:33 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZkPU/EUsZVXiRoQ1E8NMbw +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-25 10:08:38 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3qd/l8OkObSn8gTKTsHrkA __PACKAGE__->belongs_to( "guarantor", diff --git a/Koha/Schema/Result/Deletedborrower.pm b/Koha/Schema/Result/Deletedborrower.pm index dc20a65d4e..e9c28b1cc5 100644 --- a/Koha/Schema/Result/Deletedborrower.pm +++ b/Koha/Schema/Result/Deletedborrower.pm @@ -448,12 +448,11 @@ __PACKAGE__->table("deletedborrowers"); data_type: 'mediumtext' is_nullable: 1 -=head2 flgAnonymized +=head2 anonymized - accessor: 'flg_anonymized' data_type: 'tinyint' default_value: 0 - is_nullable: 1 + is_nullable: 0 =cut @@ -645,18 +644,13 @@ __PACKAGE__->add_columns( { data_type => "integer", default_value => 0, is_nullable => 1 }, "overdrive_auth_token", { data_type => "mediumtext", is_nullable => 1 }, - "flgAnonymized", - { - accessor => "flg_anonymized", - data_type => "tinyint", - default_value => 0, - is_nullable => 1, - }, + "anonymized", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-17 11:11:33 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9XbNY+E7YqzsiUldTFg6Zg +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-25 10:08:38 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hzKeGjtecf3VyEvaBhDmUg # 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_21336_followup.perl b/installer/data/mysql/atomicupdate/bug_21336_followup.perl deleted file mode 100644 index ff2688900d..0000000000 --- a/installer/data/mysql/atomicupdate/bug_21336_followup.perl +++ /dev/null @@ -1,26 +0,0 @@ -$DBversion = 'XXX'; -if( CheckVersion( $DBversion ) ) { - - if ( column_exists( 'borrowers', 'flgAnonymized' ) ) { - $dbh->do(q{ - UPDATE borrowers SET flgAnonymized = 0 WHERE flgAnonymized IS NULL - }); - $dbh->do(q{ - ALTER TABLE borrowers - CHANGE `flgAnonymized` `anonymized` TINYINT(1) NOT NULL DEFAULT 0 - }); - } - - if ( column_exists( 'deletedborrowers', 'flgAnonymized' ) ) { - $dbh->do(q{ - UPDATE deletedborrowers SET flgAnonymized = 0 WHERE flgAnonymized IS NULL - }); - $dbh->do(q{ - ALTER TABLE deletedborrowers - CHANGE `flgAnonymized` `anonymized` TINYINT(1) NOT NULL DEFAULT 0 - }); - } - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 21336 - (follow-up) Rename flgAnonymized column)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 71e1db8bab..42f223abd2 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -18254,6 +18254,33 @@ if ( CheckVersion($DBversion) ) { printf "Upgrade to $DBversion done (Bug 22564 - Fix accounttype 'Rep' - %d updated)\n", $rows; } +$DBversion = '18.12.00.061'; +if( CheckVersion( $DBversion ) ) { + + if ( column_exists( 'borrowers', 'flgAnonymized' ) ) { + $dbh->do(q{ + UPDATE borrowers SET flgAnonymized = 0 WHERE flgAnonymized IS NULL + }); + $dbh->do(q{ + ALTER TABLE borrowers + CHANGE `flgAnonymized` `anonymized` TINYINT(1) NOT NULL DEFAULT 0 + }); + } + + if ( column_exists( 'deletedborrowers', 'flgAnonymized' ) ) { + $dbh->do(q{ + UPDATE deletedborrowers SET flgAnonymized = 0 WHERE flgAnonymized IS NULL + }); + $dbh->do(q{ + ALTER TABLE deletedborrowers + CHANGE `flgAnonymized` `anonymized` TINYINT(1) NOT NULL DEFAULT 0 + }); + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 21336 - (follow-up) Rename flgAnonymized column)\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5