Bug 33004: Add VENDOR_TYPE to default authorised value categories
authorKatrin Fischer <katrin.fischer.83@web.de>
Sat, 18 Feb 2023 11:01:54 +0000 (11:01 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 27 Feb 2023 16:08:07 +0000 (13:08 -0300)
To test:
* Go to administration > authorised values
* Verify that VENDOR_TYPE doesn't show in the list
* Apply patch
* Run database update
* Verify that VENDOR_TYPE does now appear and has a nice
  description (not added by this patch)
* Bonus: start over and run the web installer, VENDOR_TYPE
  should now be already there

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
installer/data/mysql/atomicupdate/bug_33004_VENDOR_TYPE_AV.pl [new file with mode: 0755]
installer/data/mysql/mandatory/auth_val_cat.sql

diff --git a/installer/data/mysql/atomicupdate/bug_33004_VENDOR_TYPE_AV.pl b/installer/data/mysql/atomicupdate/bug_33004_VENDOR_TYPE_AV.pl
new file mode 100755 (executable)
index 0000000..a30cd9e
--- /dev/null
@@ -0,0 +1,12 @@
+use Modern::Perl;
+
+return {
+    bug_number => "33004",
+    description => "Add VENDOR_TYPE authorised value category",
+    up => sub {
+        my ($args) = @_;
+        my ($dbh, $out) = @$args{qw(dbh out)};
+        $dbh->do(q{INSERT IGNORE INTO authorised_value_categories (category_name, is_system) VALUES ('VENDOR_TYPE', 1)});
+        say $out "Added new authorised value category 'VENDOR_TYPE'";
+    },
+};
index fc11f7a..6287346 100644 (file)
@@ -19,7 +19,8 @@ INSERT IGNORE INTO authorised_value_categories( category_name, is_system )
     ('PA_CLASS', 0),
     ('HOLD_CANCELLATION', 0),
     ('ROADTYPE', 0),
-    ('AR_CANCELLATION', 0);
+    ('AR_CANCELLATION', 0),
+    ('VENDOR_TYPE', 1);
 
 INSERT IGNORE INTO authorised_value_categories( category_name, is_system )
     VALUES