From 96a84ad018c8be18163842967391a27520786ac7 Mon Sep 17 00:00:00 2001
From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Date: Fri, 12 Jan 2018 11:31:42 +0100
Subject: [PATCH] Bug 18915: (QA follow-up) Add note for installs after 17.05
Content-Type: text/plain; charset=utf-8

Since the 17.05 upgrade adds the note and the sql file did not yet include
the note, we should add it when it is not there (for example new 17.11s).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested by running the dbrev while there is a letter and while not.
---
 .../mysql/atomicupdate/bug_18915_-_modifying_patron_note_notice.sql    | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/installer/data/mysql/atomicupdate/bug_18915_-_modifying_patron_note_notice.sql b/installer/data/mysql/atomicupdate/bug_18915_-_modifying_patron_note_notice.sql
index 80035b2..8fd6b6e 100644
--- a/installer/data/mysql/atomicupdate/bug_18915_-_modifying_patron_note_notice.sql
+++ b/installer/data/mysql/atomicupdate/bug_18915_-_modifying_patron_note_notice.sql
@@ -1 +1,4 @@
+-- For installations having the note already
 UPDATE letter SET code = 'CHECKOUT_NOTE', name = 'Checkout note on item set by patron', title = 'Checkout note', content = REPLACE(content, "<<biblio.item>>", "<<biblio.title>>") WHERE code = 'PATRON_NOTE';
+-- For installations coming from 17.11
+INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES ('circulation', 'CHECKOUT_NOTE', '', 'Checkout note on item set by patron', '0', 'Checkout note', '<<borrowers.firstname>> <<borrowers.surname>> has added a note to the item <<biblio.title>> - <<biblio.author>> (<<biblio.biblionumber>>).','email');
-- 
2.1.4