From 483211142335d725a3c2ab60c6c07ac7b313fccf Mon Sep 17 00:00:00 2001
From: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Date: Thu, 4 Mar 2021 15:25:54 +0000
Subject: [PATCH] Bug 25260: (QA follow-up) Fix any bad dates prior to
 migration

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
---
 installer/data/mysql/atomicupdate/bug_25260_holds_table.perl | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/installer/data/mysql/atomicupdate/bug_25260_holds_table.perl b/installer/data/mysql/atomicupdate/bug_25260_holds_table.perl
index fd2fb34e45..d5730b2f8b 100644
--- a/installer/data/mysql/atomicupdate/bug_25260_holds_table.perl
+++ b/installer/data/mysql/atomicupdate/bug_25260_holds_table.perl
@@ -42,6 +42,10 @@ if( CheckVersion( $DBversion ) ) {
             ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
         |);
 
+        # fix dates prior to migrating
+        sanitize_zero_date('reserves', 'expirationdate');
+        sanitize_zero_date('old_reserves', 'expirationdate');
+
         # migrate 'reserves' and 'old_reserves' into 'holds'
         $dbh->do(q|
             INSERT INTO holds (
-- 
2.32.0