Bugzilla – Attachment 152894 Details for
Bug 33105
Add vendor issues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33105: DB changes
Bug-33105-DB-changes.patch (text/plain), 6.42 KB, created by
Marcel de Rooy
on 2023-06-30 10:00:30 UTC
(
hide
)
Description:
Bug 33105: DB changes
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-06-30 10:00:30 UTC
Size:
6.42 KB
patch
obsolete
>From 0e0cd7d41510f09f510a67ef086b33d2927845ae Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 11 Apr 2023 15:17:24 +0200 >Subject: [PATCH] Bug 33105: DB changes >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Jonathan Field <jonathan.fieeld@ptfs-europe.com> >--- > .../data/mysql/atomicupdate/bug_33105.pl | 45 +++++++++++++++++++ > .../data/mysql/en/mandatory/auth_values.yml | 8 ++++ > installer/data/mysql/kohastructure.sql | 19 ++++++++ > .../data/mysql/mandatory/auth_val_cat.sql | 3 +- > .../data/mysql/mandatory/userpermissions.sql | 1 + > 5 files changed, 75 insertions(+), 1 deletion(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_33105.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_33105.pl b/installer/data/mysql/atomicupdate/bug_33105.pl >new file mode 100755 >index 0000000000..96b73cb142 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_33105.pl >@@ -0,0 +1,45 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "33105", >+ description => "A vendor issues", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ # Do you stuffs here >+ unless (TableExists('aqbookseller_issues')) { >+ $dbh->do(q{ >+ CREATE TABLE `aqbookseller_issues` ( >+ `issue_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key and unique identifier assigned by Koha', >+ `vendor_id` int(11) NOT NULL COMMENT 'link to the vendor', >+ `type` varchar(80) DEFAULT NULL COMMENT "type of the issue, authorised value VENDOR_ISSUE_TYPE", >+ `started_on` date DEFAULT NULL COMMENT 'start of the issue', >+ `ended_on` date DEFAULT NULL COMMENT 'end of the issue', >+ `notes` longtext DEFAULT NULL COMMENT 'notes', >+ PRIMARY KEY (`issue_id`), >+ CONSTRAINT `aqbookseller_issues_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE >+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+ }); >+ say $out "Added new table 'aqbookseller_issues'"; >+ } >+ >+ $dbh->do(q{ >+ INSERT IGNORE INTO permissions (module_bit, code, description) VALUES >+ (11, 'issue_manage', 'Manage issues'); >+ }); >+ say $out "Added new permission 'acquisition.issue_manage'"; >+ >+ $dbh->do(q{ >+ INSERT IGNORE INTO authorised_value_categories (category_name, is_system) >+ VALUES >+ ('VENDOR_ISSUE_TYPE', 1) >+ }); >+ $dbh->do(q{ >+ INSERT IGNORE INTO authorised_values (category, authorised_value, lib) >+ VALUES >+ ('VENDOR_ISSUE_TYPE', 'MAINTENANCE', 'Maintenance'), >+ ('VENDOR_ISSUE_TYPE', 'OUTAGE', 'Outage') >+ }); >+ say $out "Added new authorised value category 'VENDOR_ISSUE_TYPE'"; >+ }, >+}; >diff --git a/installer/data/mysql/en/mandatory/auth_values.yml b/installer/data/mysql/en/mandatory/auth_values.yml >index e2f4003176..2f5ed23e9e 100644 >--- a/installer/data/mysql/en/mandatory/auth_values.yml >+++ b/installer/data/mysql/en/mandatory/auth_values.yml >@@ -275,6 +275,14 @@ tables: > authorised_value: "REPORTS" > lib: "Reports" > >+ - category: "VENDOR_ISSUE_TYPE" >+ authorised_value: "MAINTENANCE" >+ lib: "Maintenance" >+ >+ - category: "VENDOR_ISSUE_TYPE" >+ authorised_value: "OUTAGE" >+ lib: "Outage" >+ > # Country codes > - authorised_values: > translatable: [ lib, lib_opac ] >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 8c05d11cd9..f79d9fa7c4 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -466,6 +466,25 @@ CREATE TABLE `aqbooksellers` ( > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > /*!40101 SET character_set_client = @saved_cs_client */; > >+-- >+-- Table structure for table `aqbookseller_issues` >+-- >+ >+DROP TABLE IF EXISTS `aqbookseller_issues`; >+/*!40101 SET @saved_cs_client = @@character_set_client */; >+/*!40101 SET character_set_client = utf8 */; >+CREATE TABLE `aqbookseller_issues` ( >+ `issue_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key and unique identifier assigned by Koha', >+ `vendor_id` int(11) NOT NULL COMMENT 'link to the vendor', >+ `type` varchar(80) DEFAULT NULL COMMENT "type of the issue, authorised value VENDOR_ISSUE_TYPE", >+ `started_on` date DEFAULT NULL COMMENT 'start of the issue', >+ `ended_on` date DEFAULT NULL COMMENT 'end of the issue', >+ `notes` longtext DEFAULT NULL COMMENT 'notes', >+ PRIMARY KEY (`issue_id`), >+ CONSTRAINT `aqbookseller_issues_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE >+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+/*!40101 SET character_set_client = @saved_cs_client */; >+ > -- > -- Table structure for table `aqbudgetborrowers` > -- >diff --git a/installer/data/mysql/mandatory/auth_val_cat.sql b/installer/data/mysql/mandatory/auth_val_cat.sql >index 088017de93..6c20dd427a 100644 >--- a/installer/data/mysql/mandatory/auth_val_cat.sql >+++ b/installer/data/mysql/mandatory/auth_val_cat.sql >@@ -21,7 +21,8 @@ INSERT IGNORE INTO authorised_value_categories( category_name, is_system ) > ('ROADTYPE', 0), > ('AR_CANCELLATION', 0), > ('VENDOR_TYPE', 1), >- ('VENDOR_INTERFACE_TYPE', 1); >+ ('VENDOR_INTERFACE_TYPE', 1), >+ ('VENDOR_ISSUE_TYPE', 1); > > INSERT IGNORE INTO authorised_value_categories( category_name, is_system ) > VALUES >diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql >index 63da567fb7..103c27accc 100644 >--- a/installer/data/mysql/mandatory/userpermissions.sql >+++ b/installer/data/mysql/mandatory/userpermissions.sql >@@ -73,6 +73,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES > (11, 'planning_manage', 'Manage budget plannings'), > (11, 'order_manage', 'Manage baskets and order lines'), > (11, 'order_manage_all', 'Manage all baskets and order lines, regardless of restrictions on them'), >+ (11, 'issue_manage', 'Manage issues'); > (11, 'group_manage', 'Manage basket groups'), > (11, 'order_receive', 'Receive orders and manage shipments'), > (11, 'budget_add_del', 'Add and delete funds (but can''t modify funds)'), >-- >2.30.2
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 33105
:
149509
|
149510
|
149511
|
149512
|
149513
|
149514
|
149515
|
149530
|
149531
|
149532
|
149556
|
149557
|
149558
|
149559
|
149560
|
149561
|
149562
|
152894
|
152895
|
152896
|
152897
|
152898
|
152899
|
152900
|
153117
|
153118
|
153119
|
153122
|
153123
|
153125
|
153126
|
153127
|
153128
|
153129
|
153130
|
153131
|
153132
|
153133
|
153134
|
153135
|
153136
|
153137
|
153730
|
153731