From c11f8cb622dbf464adbc484ea9e174218382cd7c Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Tue, 21 Jun 2011 15:06:51 +0100 Subject: [PATCH] Bug 5549 : Add script to convert issue_dates --- .../data/mysql/atomicupdate/issuedate_times.pl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/issuedate_times.pl diff --git a/installer/data/mysql/atomicupdate/issuedate_times.pl b/installer/data/mysql/atomicupdate/issuedate_times.pl new file mode 100644 index 0000000000..864109a1fe --- /dev/null +++ b/installer/data/mysql/atomicupdate/issuedate_times.pl @@ -0,0 +1,17 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use C4::Context; + +my $dbh = C4::Context->dbh; + +$dbh->do("ALTER TABLE issues CHANGE date_due date_due datetime"); +$dbh->do("ALTER TABLE issues CHANGE returndate returndate datetime"); +$dbh->do("ALTER TABLE issues CHANGE lastreneweddate lastreneweddate datetime"); +$dbh->do("ALTER TABLE issues CHANGE issuedate issuedate datetime"); +$dbh->do("ALTER TABLE old_issues CHANGE date_due date_due datetime"); +$dbh->do("ALTER TABLE old_issues CHANGE returndate returndate datetime"); +$dbh->do("ALTER TABLE old_issues CHANGE lastreneweddate lastreneweddate datetime"); +$dbh->do("ALTER TABLE old_issues CHANGE issuedate issuedate datetime"); +$dbh->do(q{update issues set date_due = addtime(date_due, '0 23:0:0') where hour(date_due) = 0}); -- 2.39.5