Bugzilla – Attachment 55834 Details for
Bug 17356
Add atomic update .perl skeleton file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17356: Add atomic update .perl skeleton file
Bug-17356-Add-atomic-update-perl-skeleton-file.patch (text/plain), 2.03 KB, created by
Jonathan Druart
on 2016-09-27 07:33:21 UTC
(
hide
)
Description:
Bug 17356: Add atomic update .perl skeleton file
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-09-27 07:33:21 UTC
Size:
2.03 KB
patch
obsolete
>From 4db081d9ca657f4423dc5e0ea03bd44a90b2ac11 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 27 Sep 2016 08:30:12 +0100 >Subject: [PATCH] Bug 17356: Add atomic update .perl skeleton file > >To show devs how it should be written. > >Test plan: >% cp installer/data/mysql/atomicupdate/skeleton.perl >installer/data/mysql/atomicupdate/bug_XXXXX.perl >% perl installer/data/mysql/updatedatabase.pl > >You should see: >DEV atomic update: bug_xxxxx.perl >Upgrade to 16.06.00.XXX done (Bug XXXXX - description) >--- > installer/data/mysql/atomicupdate/skeleton.perl | 11 +++++++++++ > installer/data/mysql/updatedatabase.pl | 1 + > 2 files changed, 12 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/skeleton.perl > >diff --git a/installer/data/mysql/atomicupdate/skeleton.perl b/installer/data/mysql/atomicupdate/skeleton.perl >new file mode 100644 >index 0000000..a620ad3 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/skeleton.perl >@@ -0,0 +1,11 @@ >+use C4::Installer; >+my $dbh = C4::Context->dbh; >+$DBversion = '16.06.00.XXX'; >+if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >+ unless( column_exists( 'biblio', 'biblionumber' ) ) { # or constraint_exists( $table_name, $key_name ) >+ warn "There is something wrong"; >+ } >+ SetVersion ($DBversion); >+ print "Upgrade to $DBversion done (Bug XXXXX - description)\n"; >+} >+ >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index d8b6475..567b27b 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -13070,6 +13070,7 @@ my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/ato > opendir( my $dirh, $update_dir ); > foreach my $file ( sort readdir $dirh ) { > next if $file !~ /\.(sql|perl)$/; #skip other files >+ next if $file eq 'skeleton.perl'; # skip the skeleton file > print "DEV atomic update: $file\n"; > if ( $file =~ /\.sql$/ ) { > my $installer = C4::Installer->new(); >-- >2.8.1
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 17356
:
55834
|
55944
|
55945
|
56444
|
56445
|
56446