Bugzilla – Attachment 36716 Details for
Bug 13068
New feature for DB update and sandbox
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
updatedatabase improvement
0001-Bug-13068-updatedatabase-improvement-for-developer-p.patch (text/plain), 2.03 KB, created by
Paul Poulain
on 2015-03-06 16:26:58 UTC
(
hide
)
Description:
updatedatabase improvement
Filename:
MIME Type:
Creator:
Paul Poulain
Created:
2015-03-06 16:26:58 UTC
Size:
2.03 KB
patch
obsolete
>From 1af13b760d1c63a0dcef5ff2fcc3c57662459e2a Mon Sep 17 00:00:00 2001 >From: Paul Poulain <paul.poulain@biblibre.com> >Date: Fri, 6 Mar 2015 16:38:45 +0100 >Subject: [PATCH 1/4] Bug 13068, updatedatabase improvement for developer > process > >with this patch, the updatedatabase now checks info the atomicupdate directory. If there is some SQL here, it's executed. >Note that there is no version update, so if you run the updatedatabase script twice, you'll get an sql error probably. > >This patch will be very useful for sandbox testing process. > >When the RM pushes a patch with something in db_update, he will have to copy it into updatedatabase.pl, give it a number, and remove the file in db_update > >Test plan: > * apply the patch > * create a files with a .sql extension in the atomicupdate directory > * run updatedatabase.pl > * look at your database, what was in the .sql file must have been run >--- > installer/data/mysql/updatedatabase.pl | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index bd39629..5ed4b8d 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -38,6 +38,7 @@ use C4::Context; > use C4::Installer; > use C4::Dates; > >+use File::Slurp; > use MARC::Record; > use MARC::File::XML ( BinaryEncoding => 'utf8' ); > >@@ -9804,6 +9805,21 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+# DEVELOPER PROCESS, search for anything to execute in the db_update directory >+# SEE bug 13068 >+# if there is anything in the atomicupdate, read and execute it. >+ >+opendir( my $dirh, C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate' ); >+my $old_delimiter = $/; >+$/ = ';'; >+while (readdir $dirh) { >+ next unless $_ =~ /\.sql$/; # skip non SQL files >+ my $installer = C4::Installer->new(); >+ $rv = $installer->load_sql( $atomicupd->{location}. "/$file" )? 0: 1; >+ #Note: load_sql already warns >+} >+ >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >-- >1.7.10.4 >
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 13068
:
32173
|
32174
|
32175
|
32177
|
32178
|
32179
|
32180
|
32185
|
32294
|
32300
|
32398
|
32399
|
32525
|
32526
|
32658
|
32659
|
32784
|
32785
|
32839
|
32840
|
32841
|
32842
|
32843
|
32919
|
32921
|
33859
|
34070
|
34071
|
34072
|
34949
|
34950
|
34951
|
34960
|
34998
|
35000
|
35001
|
35002
|
35003
|
35366
|
35367
|
35368
|
35370
|
36716
|
36717
|
36718
|
36719
|
36779
|
36780
|
36781
|
36792
|
37061
|
37062
|
37063
|
37064
|
37065
|
37066
|
37075
|
37076
|
37491