From 104b87c9a093e5a2aa859f9d2d63ed2b8556bcaa Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 2 Mar 2020 09:45:47 +0000 Subject: [PATCH] Bug 22273: DBRev 19.12.00.031 Signed-off-by: Martin Renvoize --- Koha.pm | 2 +- Koha/Schema/Result/ArticleRequest.pm | 16 ++++++++-------- installer/data/mysql/atomicupdate/bug22273.perl | 8 -------- installer/data/mysql/updatedatabase.pl | 9 +++++++++ 4 files changed, 18 insertions(+), 17 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug22273.perl diff --git a/Koha.pm b/Koha.pm index aac93237fc..1867388df2 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 = "19.12.00.030"; +$VERSION = "19.12.00.031"; sub version { return $VERSION; diff --git a/Koha/Schema/Result/ArticleRequest.pm b/Koha/Schema/Result/ArticleRequest.pm index e26f5c4304..b787c91eca 100644 --- a/Koha/Schema/Result/ArticleRequest.pm +++ b/Koha/Schema/Result/ArticleRequest.pm @@ -110,14 +110,14 @@ __PACKAGE__->table("article_requests"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp - is_nullable: 0 + is_nullable: 1 =head2 updated_on data_type: 'timestamp' datetime_undef_if_invalid: 1 - is_nullable: 1 + default_value: current_timestamp + is_nullable: 0 =cut @@ -161,14 +161,14 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", - is_nullable => 0, + is_nullable => 1, }, "updated_on", { data_type => "timestamp", datetime_undef_if_invalid => 1, - is_nullable => 1, + default_value => \"current_timestamp", + is_nullable => 0, }, ); @@ -257,8 +257,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BOBB3vld8wY75u45YldoEg +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-02 09:44:27 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Dhz1mVI7Z/6ibqaBZkPvUA # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/installer/data/mysql/atomicupdate/bug22273.perl b/installer/data/mysql/atomicupdate/bug22273.perl deleted file mode 100644 index 82d114b7b1..0000000000 --- a/installer/data/mysql/atomicupdate/bug22273.perl +++ /dev/null @@ -1,8 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - $dbh->do( q| -ALTER TABLE article_requests MODIFY COLUMN created_on timestamp NULL, MODIFY COLUMN updated_on timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() - |); - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 22273: Column article_requests.created_on should not be updated)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 065a02b1b9..42bb7ca2c4 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -20956,6 +20956,15 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 22880: Move contents of opacheader preference to Koha news system)\n"; } +$DBversion = '19.12.00.031'; +if( CheckVersion( $DBversion ) ) { + $dbh->do( q| +ALTER TABLE article_requests MODIFY COLUMN created_on timestamp NULL, MODIFY COLUMN updated_on timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() + |); + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 22273: Column article_requests.created_on should not be updated)\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; -- 2.39.5