Bugzilla – Attachment 154006 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), 3.79 KB, created by
Agustín Moyano
on 2023-07-27 23:23:43 UTC
(
hide
)
Description:
Bug 32607: Add table and permissions
Filename:
MIME Type:
Creator:
Agustín Moyano
Created:
2023-07-27 23:23:43 UTC
Size:
3.79 KB
patch
obsolete
>From c328a0b1d0c8ebc787c8f900602b589a7da736ca Mon Sep 17 00:00:00 2001 >From: Agustin Moyano <agustinmoyano@theke.io> >Date: Thu, 2 Feb 2023 16:57:38 -0300 >Subject: [PATCH] Bug 32607: Add table and permissions > >Adds a new table called import_sources and a user permission called manage_import_sources >--- > .../data/mysql/atomicupdate/bug_32607.pl | 32 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 14 ++++++++ > .../data/mysql/mandatory/userpermissions.sql | 1 + > 3 files changed, 47 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 0000000000..252361d122 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_32607.pl >@@ -0,0 +1,32 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "32607", >+ description => "Add import_source table", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ # Do you stuffs here >+ if(!TableExists('import_source')) { >+ $dbh->do(q{ >+ CREATE TABLE `import_source` ( >+ `import_source_id` int(11) NOT NULL AUTO_INCREMENT, >+ `name` text NOT NULL, >+ `patron_id` int(11) NOT NULL, >+ PRIMARY KEY (`import_source_id`), >+ CONSTRAINT `import_source_fk_1` FOREIGN KEY (`patron_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE >+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci >+ }); >+ } >+ >+ say $out "Added new import_source table"; >+ >+ $dbh->do(q{ >+ INSERT IGNORE INTO permissions (module_bit, code, description) VALUES >+ ( 3, 'manage_import_sources', 'Manage import sources') >+ }); >+ >+ say $out "Added new manage_import_sources permission"; >+ >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index c1f800fe7f..d0aac05749 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -3467,6 +3467,20 @@ 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 `import_source` >+-- >+ >+DROP TABLE IF EXISTS `import_source`; >+/*!40101 SET @saved_cs_client = @@character_set_client */; >+/*!40101 SET character_set_client = utf8 */; >+CREATE TABLE `import_source` ( >+ `import_source_id` int(11) NOT NULL AUTO_INCREMENT, >+ `name` text NOT NULL, >+ `patron_id` int(11) NOT NULL, >+ PRIMARY KEY (`import_source_id`), >+ CONSTRAINT `import_source_fk_1` FOREIGN KEY (`patron_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE 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 2f84c9bc2f..0fed4c6d50 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_import_sources', 'Manage import 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.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 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