From 0a3f98cc18dce2b82df3ec1de230a3663dd553ee Mon Sep 17 00:00:00 2001
From: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Date: Wed, 3 Jun 2020 16:01:39 +0100
Subject: [PATCH] Bug 23091: Database update

This patch updates the 'refund' circulation rule to be called
'lostreturn' and populates the value with 'refund' where appropriate.
---
 installer/data/mysql/atomicupdate/bug_23091.perl | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 installer/data/mysql/atomicupdate/bug_23091.perl

diff --git a/installer/data/mysql/atomicupdate/bug_23091.perl b/installer/data/mysql/atomicupdate/bug_23091.perl
new file mode 100644
index 0000000000..a0b02d3556
--- /dev/null
+++ b/installer/data/mysql/atomicupdate/bug_23091.perl
@@ -0,0 +1,7 @@
+$DBversion = 'XXX'; # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+    $dbh->do( "UPDATE circulation_rules SET rule_name = 'lostreturn' WHERE rule_name = 'refund'" );
+    $dbh->do( "UPDATE circulation_rules SET rule_value = 'refund' WHERE rule_name = 'lostreturn' AND rule_value = 1" );
+
+    NewVersion( $DBversion, 23091, "Update refund rules");
+}
-- 
2.20.1