From 12bac04164beeba2230089a6207c4436c704df12 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 19 Mar 2020 09:18:45 +0000 Subject: [PATCH] Bug 24818: DBRev 19.12.00.046 Signed-off-by: Martin Renvoize --- Koha.pm | 2 +- Koha/Schema/Result/Accountline.pm | 12 ++++++++---- installer/data/mysql/atomicupdate/bug_24818.perl | 8 -------- installer/data/mysql/updatedatabase.pl | 9 +++++++++ 4 files changed, 18 insertions(+), 13 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_24818.perl diff --git a/Koha.pm b/Koha.pm index 8d4359427a..5536c195fd 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.045"; +$VERSION = "19.12.00.046"; sub version { return $VERSION; diff --git a/Koha/Schema/Result/Accountline.pm b/Koha/Schema/Result/Accountline.pm index 1d455e655c..12bb08c17e 100644 --- a/Koha/Schema/Result/Accountline.pm +++ b/Koha/Schema/Result/Accountline.pm @@ -48,7 +48,7 @@ __PACKAGE__->table("accountlines"); =head2 date - data_type: 'date' + data_type: 'timestamp' datetime_undef_if_invalid: 1 is_nullable: 1 @@ -144,7 +144,11 @@ __PACKAGE__->add_columns( "itemnumber", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "date", - { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, "amount", { data_type => "decimal", is_nullable => 1, size => [28, 6] }, "description", @@ -363,8 +367,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-24 16:33:42 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:q4Ahb8xIxAsjT/aF9yjrdQ +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-19 09:20:20 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BuE4CYsSH4BwXZoQKE2MWw sub koha_objects_class { 'Koha::Account::Lines'; diff --git a/installer/data/mysql/atomicupdate/bug_24818.perl b/installer/data/mysql/atomicupdate/bug_24818.perl deleted file mode 100644 index 773f65d2b4..0000000000 --- a/installer/data/mysql/atomicupdate/bug_24818.perl +++ /dev/null @@ -1,8 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - - $dbh->do( "ALTER TABLE accountlines MODIFY COLUMN date TIMESTAMP NULL" ); - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 24818: Update 'accountlines.date' from DATE to TIMESTAMP)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 60e4d01ce2..90b9cf97f0 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -21182,6 +21182,15 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 4461 - Add CollapseFieldsPatronAddForm system preference)\n"; } +$DBversion = '19.12.00.046'; +if( CheckVersion( $DBversion ) ) { + + $dbh->do( "ALTER TABLE accountlines MODIFY COLUMN date TIMESTAMP NULL" ); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 24818: Update 'accountlines.date' from DATE to TIMESTAMP)\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