Bugzilla – Attachment 187916 Details for
Bug 38489
EDI should be updated to use the new FTP/SFTP Servers management page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38489: (follow-up) Make old db_rev more idempotent
Bug-38489-follow-up-Make-old-dbrev-more-idempotent.patch (text/plain), 2.43 KB, created by
Martin Renvoize (ashimema)
on 2025-10-15 14:54:45 UTC
(
hide
)
Description:
Bug 38489: (follow-up) Make old db_rev more idempotent
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-10-15 14:54:45 UTC
Size:
2.43 KB
patch
obsolete
>From b23d93aaf4675192cd22ca25c917decad7d264fc Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Wed, 15 Oct 2025 15:52:17 +0100 >Subject: [PATCH] Bug 38489: (follow-up) Make old db_rev more idempotent > >In the unit test system we reset the database version to 21.11 after >having upgraded a long way past that. The 221200041 update appears not >to be fully idempotent, so we fail running through the upgrade. >--- > installer/data/mysql/db_revs/221200041.pl | 30 +++++++++++++---------- > 1 file changed, 17 insertions(+), 13 deletions(-) > >diff --git a/installer/data/mysql/db_revs/221200041.pl b/installer/data/mysql/db_revs/221200041.pl >index 5687b1f08a3..317486033dc 100755 >--- a/installer/data/mysql/db_revs/221200041.pl >+++ b/installer/data/mysql/db_revs/221200041.pl >@@ -6,22 +6,26 @@ return { > up => sub { > my ($args) = @_; > my ( $dbh, $out ) = @$args{qw(dbh out)}; >- $dbh->do( >- q{ >+ if ( !column_exists( 'vendor_edi_accounts', 'password' ) ) { >+ $dbh->do( >+ q{ > ALTER TABLE vendor_edi_accounts CHANGE COLUMN `password` `password` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL > } >- ); >+ ); > >- my $edi_vendors = >- $dbh->selectall_arrayref( "SELECT * FROM vendor_edi_accounts", { Slice => {} } ); >- if (@$edi_vendors) { >- require Koha::Encryption; >- my $e = Koha::Encryption->new; >- for my $edi_vendor (@$edi_vendors) { >- my $id = $edi_vendor->{id}; >- my $password = $edi_vendor->{password}; >- $password = $e->encrypt_hex($password); >- $dbh->do("UPDATE vendor_edi_accounts SET password = '$password' WHERE id = $id"); >+ my $edi_vendors = $dbh->selectall_arrayref( >+ "SELECT * FROM vendor_edi_accounts", >+ { Slice => {} } >+ ); >+ if (@$edi_vendors) { >+ require Koha::Encryption; >+ my $e = Koha::Encryption->new; >+ for my $edi_vendor (@$edi_vendors) { >+ my $id = $edi_vendor->{id}; >+ my $password = $edi_vendor->{password}; >+ $password = $e->encrypt_hex($password); >+ $dbh->do("UPDATE vendor_edi_accounts SET password = '$password' WHERE id = $id"); >+ } > } > } > }, >-- >2.51.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 38489
:
175204
|
175205
|
175206
|
175207
|
176118
|
176119
|
176161
|
185324
|
186819
|
186820
|
186845
|
186846
|
186847
|
186848
|
186849
|
186850
|
186851
|
186852
|
186854
|
187080
|
187081
|
187082
|
187083
|
187084
|
187085
|
187086
|
187087
|
187088
|
187089
|
187108
|
187147
|
187148
|
187149
|
187150
|
187151
|
187152
|
187153
|
187154
|
187155
|
187156
|
187157
|
187158
|
187159
|
187270
|
187271
|
187272
|
187273
|
187274
|
187275
|
187276
|
187277
|
187278
|
187279
|
187280
|
187281
|
187283
|
187284
|
187285
|
187286
|
187287
|
187288
|
187289
|
187290
|
187291
|
187292
|
187293
|
187294
|
187861
|
187862
|
187863
|
187864
|
187865
|
187866
|
187867
|
187868
|
187869
|
187870
|
187871
|
187872
|
187873
|
187897
|
187916
|
187918
|
187923
|
187924
|
187925
|
187926