Bugzilla – Attachment 120689 Details for
Bug 28301
Add ability to force re-run of a particular DB update
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28301: Add forced run of particular DB update
Bug-28301-Add-forced-run-of-particular-DB-update.patch (text/plain), 1.69 KB, created by
Nick Clemens (kidclamp)
on 2021-05-07 13:11:51 UTC
(
hide
)
Description:
Bug 28301: Add forced run of particular DB update
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-05-07 13:11:51 UTC
Size:
1.69 KB
patch
obsolete
>From f0258dcd9f10598e4477539b9d8c584eaf55ad6b Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 7 May 2021 13:05:41 +0000 >Subject: [PATCH] Bug 28301: Add forced run of particular DB update > >This patch adds a --forcedversion option to the updatedatabase script >in order to allow testing of a particular update > >To test: >1 - Apply patch >2 - Pick a DB update that will fail if rerun >3 - perl /kohadevbox/koha/installer/data/mysql/updatedatabase.pl --forcedversion="3.21.00.041" >4 - Confirm it ran, you should get an error :-) >5 - Check the version system preference, confirm it is unchanged > SELECT value FROM systempreference WHERE variable='Version'; >--- > installer/data/mysql/updatedatabase.pl | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index bb438f901f..c2c1db911f 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -62,9 +62,13 @@ my ( > my $schema = Koha::Database->new()->schema(); > > my $silent; >+my $forced_run_version; >+ > GetOptions( >- 's' =>\$silent >+ 's' =>\$silent, >+ 'forcedversion:s' => \$forced_run_version, > ); >+ > my $dbh = C4::Context->dbh; > $|=1; # flushes output > >@@ -24277,6 +24281,7 @@ sub SetVersion { > > sub NewVersion { > my ( $DBversion, $bug_number, $descriptions ) = @_; >+ return if $forced_run_version; > > SetVersion($DBversion); > >@@ -24330,6 +24335,9 @@ sub CheckVersion { > { > return 1; > } >+ elsif ($forced_run_version && TransformToNum($forced_run_version) == $version_number ) { >+ return 1; >+ } > else { > return 0; > } >-- >2.11.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 28301
: 120689