Bugzilla – Attachment 181010 Details for
Bug 37901
Add ILL pseudonymization
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37901: Preparation: atomic update
Bug-37901-Preparation-atomic-update.patch (text/plain), 2.72 KB, created by
Pedro Amorim
on 2025-04-16 15:43:39 UTC
(
hide
)
Description:
Bug 37901: Preparation: atomic update
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-04-16 15:43:39 UTC
Size:
2.72 KB
patch
obsolete
>From 092f86eefac19d80b89b9a3554db757650addf2d Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Mon, 3 Mar 2025 10:10:08 -0100 >Subject: [PATCH] Bug 37901: Preparation: atomic update > >Rename the table pseudonymized_borrower_attributes to pseudonymized_metadata_values >This is so that pseudonymizing other 'extended_attributes' type of data, >such as illrequestsattributes, becomes possible. >--- > .../data/mysql/atomicupdate/bug_37901.pl | 41 +++++++++++++++++++ > 1 file changed, 41 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_37901.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_37901.pl b/installer/data/mysql/atomicupdate/bug_37901.pl >new file mode 100755 >index 00000000000..69bc27a7748 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_37901.pl >@@ -0,0 +1,41 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_success say_info); >+ >+return { >+ bug_number => "37901", >+ description => "Update pseudonymized_borrower_attributes to pseudonymized_metadata_values", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ if ( TableExists('pseudonymized_borrower_attributes') ) { >+ say_info( $out, "Renaming table 'pseudonymized_borrower_attributes' to 'pseudonymized_metadata_values" ); >+ $dbh->do( >+ q{ >+ CREATE TABLE `pseudonymized_metadata_values` ( >+ `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Row id field', >+ `transaction_id` int(11) NOT NULL, >+ `tablename` varchar(64) NOT NULL COMMENT 'Name of the related table', >+ `key` varchar(64) NOT NULL COMMENT 'key for the metadata', >+ `value` varchar(255) DEFAULT NULL COMMENT 'value for the metadata', >+ PRIMARY KEY (`id`), >+ KEY `pseudonymized_metadata_values_ibfk_1` (`transaction_id`), >+ CONSTRAINT `pseudonymized_metadata_values_ibfk_1` FOREIGN KEY (`transaction_id`) REFERENCES `pseudonymized_transactions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE >+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+ } >+ ); >+ >+ $dbh->do( >+ q{ >+ INSERT INTO pseudonymized_metadata_values( transaction_id, tablename, `key`, value ) >+ SELECT transaction_id, 'borrower_attributes', code, attribute >+ FROM pseudonymized_borrower_attributes; >+ } >+ ); >+ >+ $dbh->do(q{ DROP TABLE pseudonymized_borrower_attributes; }); >+ } >+ >+ say_success( $out, "Finished" ); >+ }, >+}; >-- >2.39.5
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 37901
:
178356
|
178956
|
178957
|
178958
|
178959
|
178960
|
178961
|
178962
|
178963
|
178964
|
178965
|
178966
|
178967
|
178968
|
178980
|
178981
|
178982
|
178983
|
178984
|
178985
|
178986
|
178987
|
178988
|
178989
|
178990
|
178991
|
178992
|
181008
|
181009
| 181010 |
181011
|
181012
|
181013
|
181014
|
181015
|
181016
|
181017
|
181018
|
181019
|
181020