Bugzilla – Attachment 98482 Details for
Bug 24592
Clarify LOST_RETURN process by using FOUND over RETURNED
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24592: Database Update
Bug-24592-Database-Update.patch (text/plain), 2.43 KB, created by
Martin Renvoize (ashimema)
on 2020-02-05 13:46:11 UTC
(
hide
)
Description:
Bug 24592: Database Update
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-02-05 13:46:11 UTC
Size:
2.43 KB
patch
obsolete
>From 3e6dc3ed70a3ed13476094bdd51ec6d0549f734a Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 5 Feb 2020 12:19:34 +0000 >Subject: [PATCH] Bug 24592: Database Update > >--- > installer/data/mysql/account_credit_types.sql | 2 +- > .../data/mysql/atomicupdate/bug_24592.perl | 41 +++++++++++++++++++ > 2 files changed, 42 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_24592.perl > >diff --git a/installer/data/mysql/account_credit_types.sql b/installer/data/mysql/account_credit_types.sql >index 5cf04abb15..70a51629d8 100644 >--- a/installer/data/mysql/account_credit_types.sql >+++ b/installer/data/mysql/account_credit_types.sql >@@ -4,7 +4,7 @@ INSERT INTO account_credit_types ( code, description, can_be_added_manually, is_ > ('FORGIVEN', 'Forgiven', 1, 1), > ('CREDIT', 'Credit', 1, 1), > ('REFUND', 'A refund applied to a patrons fine', 0, 1), >-('LOST_RETURN', 'Lost item fee refund', 0, 1), >+('LOST_FOUND', 'Lost item fee refund', 0, 1), > ('PURCHASE', 'Purchase', 0, 1); > > INSERT INTO authorised_values (category,authorised_value,lib) VALUES ('PAYMENT_TYPE','CASH','Cash'); >diff --git a/installer/data/mysql/atomicupdate/bug_24592.perl b/installer/data/mysql/atomicupdate/bug_24592.perl >new file mode 100644 >index 0000000000..d079bb801b >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_24592.perl >@@ -0,0 +1,41 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ >+ # Add LOST_FOUND debit type >+ $dbh->do(qq{ >+ INSERT IGNORE INTO >+ account_credit_types ( code, description, can_be_added_manually, is_system ) >+ VALUES >+ ('LOST_FOUND', 'Lost item fee refund', 0, 1) >+ }); >+ >+ # Migrate LOST_RETURN to LOST_FOUND >+ $dbh->do(qq{ >+ UPDATE >+ accountlines >+ SET >+ credit_type_code = 'LOST_FOUND' >+ WHERE >+ credit_type_code = 'LOST_RETURN' >+ }); >+ >+ # Migrate LOST + RETURNED to LOST + FOUND >+ $dbh->do(qq{ >+ UPDATE >+ accountlines >+ SET >+ status = 'FOUND' >+ WHERE >+ debit_type_code = 'LOST' >+ AND >+ status = 'RETURNED' >+ }); >+ >+ # Drop LOST_RETURNED credit type >+ $dbh->do(qq{ >+ DELETE FROM account_credit_types WHERE code = 'LOST_RETURN' >+ }); >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 24592 - Update LOST_RETURN to LOST_FOUND)\n"; >+} >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24592
:
98457
|
98458
|
98481
|
98482
|
98643
|
98644
|
98680
|
98681
|
98852
|
98853