Bugzilla – Attachment 103837 Details for
Bug 17355
Authorised value categories cannot be deleted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17355: DB changes - set is_system for categories
Bug-17355-DB-changes---set-issystem-for-categories.patch (text/plain), 3.75 KB, created by
Jonathan Druart
on 2020-04-28 10:08:13 UTC
(
hide
)
Description:
Bug 17355: DB changes - set is_system for categories
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-04-28 10:08:13 UTC
Size:
3.75 KB
patch
obsolete
>From 0c12ae6c569a0dd05c4b2efc22b084731cdafb8c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 28 Apr 2020 11:32:23 +0200 >Subject: [PATCH] Bug 17355: DB changes - set is_system for categories > >--- > .../data/mysql/atomicupdate/bug_17355.perl | 12 +++ > .../data/mysql/mandatory/auth_val_cat.sql | 86 +++++++++---------- > 2 files changed, 55 insertions(+), 43 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_17355.perl b/installer/data/mysql/atomicupdate/bug_17355.perl >index d0c5243cdb..ce14cae77a 100644 >--- a/installer/data/mysql/atomicupdate/bug_17355.perl >+++ b/installer/data/mysql/atomicupdate/bug_17355.perl >@@ -8,6 +8,18 @@ if( CheckVersion( $DBversion ) ) { > |); > } > >+ $dbh->do(q| >+ UPDATE authorised_value_categories >+ SET is_system = 1 >+ WHERE category_name IN ('LOC', 'LOST', 'WITHDRAWN', 'Bsort1', 'Bsort2', 'Asort1', 'Asort2', 'SUGGEST', 'DAMAGED', 'LOST', 'BOR_NOTES', 'CCODE', 'NOT_LOAN') >+ |); >+ >+ $dbh->do(q| >+ UPDATE authorised_value_categories >+ SET is_system = 1 >+ WHERE category_name IN ('branches', 'itemtypes', 'cn_source') >+ |); >+ > # Always end with this (adjust the bug info) > NewVersion( $DBversion, 17355, "Description"); > } >diff --git a/installer/data/mysql/mandatory/auth_val_cat.sql b/installer/data/mysql/mandatory/auth_val_cat.sql >index cca989c9df..c45b5985dd 100644 >--- a/installer/data/mysql/mandatory/auth_val_cat.sql >+++ b/installer/data/mysql/mandatory/auth_val_cat.sql >@@ -1,51 +1,51 @@ >-INSERT IGNORE INTO authorised_value_categories( category_name ) >+INSERT IGNORE INTO authorised_value_categories( category_name, is_system ) > VALUES >- (''), >- ('Asort1'), >- ('Asort2'), >- ('Bsort1'), >- ('Bsort2'), >- ('SUGGEST'), >- ('SUGGEST_STATUS'), >- ('SUGGEST_FORMAT'), >- ('DAMAGED'), >- ('LOST'), >- ('REPORT_GROUP'), >- ('REPORT_SUBGROUP'), >- ('DEPARTMENT'), >- ('TERM'), >- ('ITEMTYPECAT'), >- ('PAYMENT_TYPE'), >- ('PA_CLASS'), >- ('ROADTYPE'); >+ ('', 1), >+ ('Asort1', 1), >+ ('Asort2', 1), >+ ('Bsort1', 1), >+ ('Bsort2', 1), >+ ('SUGGEST', 0), >+ ('SUGGEST_STATUS', 0), >+ ('SUGGEST_FORMAT', 0), >+ ('DAMAGED', 1), >+ ('LOST', 1), >+ ('REPORT_GROUP', 0), >+ ('REPORT_SUBGROUP', 0), >+ ('DEPARTMENT', 0), >+ ('TERM', 0), >+ ('ITEMTYPECAT', 0), >+ ('PAYMENT_TYPE', 0), >+ ('PA_CLASS', 0), >+ ('ROADTYPE', 0); > >-INSERT IGNORE INTO authorised_value_categories( category_name ) >+INSERT IGNORE INTO authorised_value_categories( category_name, is_system ) > VALUES >- ('branches'), >- ('itemtypes'), >- ('cn_source'); >+ ('branches', 1), >+ ('itemtypes', 1), >+ ('cn_source', 1); > >-INSERT IGNORE INTO authorised_value_categories( category_name ) >+INSERT IGNORE INTO authorised_value_categories( category_name, is_system ) > VALUES >- ('WITHDRAWN'), >- ('RESTRICTED'), >- ('NOT_LOAN'), >- ('CCODE'), >- ('LOC'), >- ('BOR_NOTES'), >- ('OPAC_SUG'), >- ('SIP_MEDIA_TYPE'), >- ('ORDER_CANCELLATION_REASON'), >- ('RELTERMS'), >- ('YES_NO'), >- ('LANG'), >- ('HINGS_UT'), >- ('HINGS_PF'), >- ('HINGS_C'), >- ('HINGS_AS'), >- ('HINGS_RD'), >- ('STACK'), >- ('CONTROL_NUM_SEQUENCE'); >+ ('WITHDRAWN', 1), >+ ('RESTRICTED', 0), >+ ('NOT_LOAN', 1), >+ ('CCODE', 1), >+ ('LOC', 1), >+ ('BOR_NOTES', 1), >+ ('OPAC_SUG', 0), >+ ('SIP_MEDIA_TYPE', 0), >+ ('ORDER_CANCELLATION_REASON', 0), >+ ('RELTERMS', 0), >+ ('YES_NO', 0), >+ ('LANG', 0), >+ ('HINGS_UT', 0), >+ ('HINGS_PF', 0), >+ ('HINGS_C', 0), >+ ('HINGS_AS', 0), >+ ('HINGS_RD', 0), >+ ('STACK', 0), >+ ('CONTROL_NUM_SEQUENCE' ,0); > > -- UNIMARC specific? > INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES >-- >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 17355
:
64102
|
65782
|
65869
|
65870
|
66022
|
66023
|
66024
|
103833
|
103834
|
103835
|
103836
|
103837
|
103838
|
104099
|
104100
|
104101
|
104102
|
104103
|
104104
|
104117
|
104118
|
104119
|
104120
|
104121
|
104122
|
104123
|
104352
|
104539