From d6fba2e2f35a840c9cff8b0c05869e0a21ca09e2 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 9 Sep 2016 10:38:43 +0000 Subject: [PATCH] Bug 15839 - DBRev 16.06.00.019 Signed-off-by: Kyle M Hall --- Koha.pm | 2 +- Koha/Schema/Result/Review.pm | 7 ++++--- installer/data/mysql/atomicupdate/bug_review.sql | 2 -- installer/data/mysql/updatedatabase.pl | 13 +++++++++++++ 4 files changed, 18 insertions(+), 6 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_review.sql diff --git a/Koha.pm b/Koha.pm index 641d8c4b96..94ffc82996 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 = "16.06.00.018"; +$VERSION = "16.06.00.019"; sub version { return $VERSION; diff --git a/Koha/Schema/Result/Review.pm b/Koha/Schema/Result/Review.pm index 64ee4ada69..a066f2a079 100644 --- a/Koha/Schema/Result/Review.pm +++ b/Koha/Schema/Result/Review.pm @@ -49,6 +49,7 @@ __PACKAGE__->table("reviews"); =head2 approved data_type: 'tinyint' + default_value: 0 is_nullable: 1 =head2 datereviewed @@ -69,7 +70,7 @@ __PACKAGE__->add_columns( "review", { data_type => "text", is_nullable => 1 }, "approved", - { data_type => "tinyint", is_nullable => 1 }, + { data_type => "tinyint", default_value => 0, is_nullable => 1 }, "datereviewed", { data_type => "datetime", @@ -133,8 +134,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:u+R08bCdVQA697aPo9zEUA +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-09-09 10:38:09 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZjW8uHIL0m7+pwOTE0pcxQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/installer/data/mysql/atomicupdate/bug_review.sql b/installer/data/mysql/atomicupdate/bug_review.sql deleted file mode 100644 index ee882dd4cd..0000000000 --- a/installer/data/mysql/atomicupdate/bug_review.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE reviews CHANGE COLUMN approved approved tinyint(4) DEFAULT 0; -UPDATE reviews SET approved=0 WHERE approved IS NULL; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index ffe2bece69..43624988d5 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -12871,6 +12871,19 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "16.06.00.019"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + ALTER TABLE reviews CHANGE COLUMN approved approved tinyint(4) DEFAULT 0; + }); + $dbh->do(q{ + UPDATE reviews SET approved=0 WHERE approved IS NULL; + }); + + print "Upgrade to $DBversion done (Bug 15839 - Move the reviews related code to Koha::Reviews)\n"; + SetVersion($DBversion); +} + # 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