From 5373bbaf5d1bdfcf997e0f9b2e67962c40374220 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 12 Feb 2018 17:52:49 -0300 Subject: [PATCH] Bug 20175: DBRev 17.12.00.013 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- Koha/Schema/Result/ClubEnrollment.pm | 10 ++++------ .../bug_xxxxx_club_enrollments.date_created.sql | 1 - installer/data/mysql/updatedatabase.pl | 11 +++++++++++ 4 files changed, 16 insertions(+), 8 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_xxxxx_club_enrollments.date_created.sql diff --git a/Koha.pm b/Koha.pm index 5aa7d80778..f35ca57bd9 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.12.00.012"; +$VERSION = "17.12.00.013"; sub version { return $VERSION; diff --git a/Koha/Schema/Result/ClubEnrollment.pm b/Koha/Schema/Result/ClubEnrollment.pm index 2f0deaada5..e970f05829 100644 --- a/Koha/Schema/Result/ClubEnrollment.pm +++ b/Koha/Schema/Result/ClubEnrollment.pm @@ -58,8 +58,7 @@ __PACKAGE__->table("club_enrollments"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: '0000-00-00 00:00:00' - is_nullable: 0 + is_nullable: 1 =head2 date_updated @@ -100,8 +99,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => "0000-00-00 00:00:00", - is_nullable => 0, + is_nullable => 1, }, "date_updated", { @@ -193,8 +191,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-04-26 16:17:25 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:a1uTIm+Y9A0jEBiumQ60jg +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-12 17:59:47 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ih/HQM4KIRDZ0ESXVR9FwA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/installer/data/mysql/atomicupdate/bug_xxxxx_club_enrollments.date_created.sql b/installer/data/mysql/atomicupdate/bug_xxxxx_club_enrollments.date_created.sql deleted file mode 100644 index 5bf3520936..0000000000 --- a/installer/data/mysql/atomicupdate/bug_xxxxx_club_enrollments.date_created.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE club_enrollments MODIFY date_created timestamp NOT NULL; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index bf1bdc296a..b6a22e613d 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -15336,6 +15336,17 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 15752 - Add system preference AutoSwitchPatron)\n"; } +$DBversion = '17.12.00.013'; +if( CheckVersion( $DBversion ) ) { + + $dbh->do(q| + ALTER TABLE club_enrollments MODIFY date_created timestamp NULL DEFAULT NULL; + |); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 20175 - Set DEFAULT NULL value for club_enrollments.date_created)\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