Bugzilla – Attachment 157756 Details for
Bug 32607
Add record sources CRUD
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32607: Add table and permissions
Bug-32607-Add-table-and-permissions.patch (text/plain), 4.70 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-10-24 19:04:38 UTC
(
hide
)
Description:
Bug 32607: Add table and permissions
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-10-24 19:04:38 UTC
Size:
4.70 KB
patch
obsolete
>From 9044c0c00b67acbee8c96163da100f18864f9f9b Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Agust=C3=ADn=20Moyano?= <agustinmoyano@theke.io> >Date: Thu, 2 Feb 2023 16:57:38 -0300 >Subject: [PATCH] Bug 32607: Add table and permissions > >This patch adds: > >* A new table: `record_sources`. >* A new user permission: `manage_record_sources`. > >Record sources will contain a name and might be linked to a patron. This >patron will be the one that has permission to use the assigned token >through API calls. The `api_token` will be generated on Koha side on >store. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > .../data/mysql/atomicupdate/bug_32607.pl | 37 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 15 ++++++++ > .../data/mysql/mandatory/userpermissions.sql | 1 + > 3 files changed, 53 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_32607.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_32607.pl b/installer/data/mysql/atomicupdate/bug_32607.pl >new file mode 100755 >index 00000000000..cd708b6e629 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_32607.pl >@@ -0,0 +1,37 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "32607", >+ description => "Add record_sources table", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ unless ( TableExists('record_sources') ) { >+ $dbh->do( >+ q{ >+ CREATE TABLE `record_sources` ( >+ `record_source_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Primary key for the `record_sources` table', >+ `name` text NOT NULL COMMENT 'User defined name for the record source', >+ `patron_id` int(11) NULL DEFAULT NULL COMMENT 'Internal patron identifier', >+ `api_token` varchar(191) NULL DEFAULT NULL COMMENT 'Generated token for identifying the record source on API interactions', >+ PRIMARY KEY (`record_source_id`), >+ CONSTRAINT `record_source_fk_1` FOREIGN KEY (`patron_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE >+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+ } >+ ); >+ >+ say $out "Added new table 'record_sources'"; >+ } >+ >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO permissions (module_bit, code, description) VALUES >+ ( 3, 'manage_record_sources', 'Manage record sources') >+ } >+ ); >+ >+ say $out "Added new permission 'manage_record_sources'"; >+ >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 394b57e48cc..b9ad3ebb048 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -3519,6 +3519,21 @@ CREATE TABLE `import_items` ( > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > /*!40101 SET character_set_client = @saved_cs_client */; > >+-- >+-- Table structure for table `record_sources` >+-- >+ >+DROP TABLE IF EXISTS `record_sources`; >+/*!40101 SET @saved_cs_client = @@character_set_client */; >+/*!40101 SET character_set_client = utf8 */; >+CREATE TABLE `record_sources` ( >+ `record_source_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Primary key for the `record_sources` table', >+ `name` text NOT NULL COMMENT 'User defined name for the record source', >+ `patron_id` int(11) NULL DEFAULT NULL COMMENT 'Internal patron identifier', >+ `api_token` varchar(191) NULL DEFAULT NULL COMMENT 'Generated token for identifying the record source on API interactions', >+ PRIMARY KEY (`record_source_id`), >+ CONSTRAINT `record_source_fk_1` FOREIGN KEY (`patron_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE >+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > -- > -- Table structure for table `import_record_matches` > -- >diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql >index 2ffe484f3e4..5bf989c43ce 100644 >--- a/installer/data/mysql/mandatory/userpermissions.sql >+++ b/installer/data/mysql/mandatory/userpermissions.sql >@@ -42,6 +42,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 3, 'manage_curbside_pickups', 'Manage curbside pickups'), > ( 3, 'manage_search_filters', 'Manage custom search filters'), > ( 3, 'manage_identity_providers', 'Manage identity providers'), >+ ( 3, 'manage_record_sources', 'Manage record sources'), > ( 4, 'delete_borrowers', 'Delete patrons'), > ( 4, 'edit_borrowers', 'Add, modify and view patron information'), > ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'), >-- >2.42.0
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 32607
:
146410
|
146411
|
146412
|
149777
|
149827
|
149828
|
149829
|
154006
|
154007
|
154008
|
154009
|
154010
|
154438
|
155682
|
155683
|
155684
|
155685
|
155686
|
155958
|
157756
|
157757
|
157758
|
157759
|
157760
|
157761
|
157762
|
161362
|
161363
|
161364
|
161365
|
161366
|
161367
|
161435
|
161436
|
161437
|
161438
|
161439
|
161440
|
161441
|
161474