Bugzilla – Attachment 37063 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]
[PASSED QA] Bug 13068: (QA followup) Remove old files, use C4::Installer
PASSED-QA-Bug-13068-QA-followup-Remove-old-files-u.patch (text/plain), 5.51 KB, created by
Kyle M Hall (khall)
on 2015-03-20 17:25:46 UTC
(
hide
)
Description:
[PASSED QA] Bug 13068: (QA followup) Remove old files, use C4::Installer
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-03-20 17:25:46 UTC
Size:
5.51 KB
patch
obsolete
>From 4c42435330199537280894f0f89f69e82659c7c8 Mon Sep 17 00:00:00 2001 >From: Paul Poulain <paul.poulain@biblibre.com> >Date: Fri, 6 Mar 2015 17:06:05 +0100 >Subject: [PATCH] [PASSED QA] Bug 13068: (QA followup) Remove old files, use C4::Installer > > * moving oai-sets.sql from atomicupdate to updatedatabase itself > * using Installer file loader to load & execute SQL file > >Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > installer/data/mysql/atomicupdate/oai_sets.sql | 35 ----------------- > installer/data/mysql/updatedatabase.pl | 48 ++++++++++++++++++++--- > 2 files changed, 41 insertions(+), 42 deletions(-) > delete mode 100644 installer/data/mysql/atomicupdate/oai_sets.sql > >diff --git a/installer/data/mysql/atomicupdate/oai_sets.sql b/installer/data/mysql/atomicupdate/oai_sets.sql >deleted file mode 100644 >index a843ab7..0000000 >--- a/installer/data/mysql/atomicupdate/oai_sets.sql >+++ /dev/null >@@ -1,35 +0,0 @@ >-DROP TABLE IF EXISTS `oai_sets_descriptions`; >-DROP TABLE IF EXISTS `oai_sets_mappings`; >-DROP TABLE IF EXISTS `oai_sets_biblios`; >-DROP TABLE IF EXISTS `oai_sets`; >- >-CREATE TABLE `oai_sets` ( >- `id` int(11) NOT NULL auto_increment, >- `spec` varchar(80) NOT NULL UNIQUE, >- `name` varchar(80) NOT NULL, >- PRIMARY KEY (`id`) >-) ENGINE=InnoDB DEFAULT CHARSET=utf8; >- >-CREATE TABLE `oai_sets_descriptions` ( >- `set_id` int(11) NOT NULL, >- `description` varchar(255) NOT NULL, >- CONSTRAINT `oai_sets_descriptions_ibfk_1` FOREIGN KEY (`set_id`) REFERENCES `oai_sets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE >-) ENGINE=InnoDB DEFAULT CHARSET=utf8; >- >-CREATE TABLE `oai_sets_mappings` ( >- `set_id` int(11) NOT NULL, >- `marcfield` char(3) NOT NULL, >- `marcsubfield` char(1) NOT NULL, >- `marcvalue` varchar(80) NOT NULL, >- CONSTRAINT `oai_sets_mappings_ibfk_1` FOREIGN KEY (`set_id`) REFERENCES `oai_sets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE >-) ENGINE=InnoDB DEFAULT CHARSET=utf8; >- >-CREATE TABLE `oai_sets_biblios` ( >- `biblionumber` int(11) NOT NULL, >- `set_id` int(11) NOT NULL, >- PRIMARY KEY (`biblionumber`, `set_id`), >- CONSTRAINT `oai_sets_biblios_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE, >- CONSTRAINT `oai_sets_biblios_ibfk_2` FOREIGN KEY (`set_id`) REFERENCES `oai_sets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE >-) ENGINE=InnoDB DEFAULT CHARSET=utf8; >- >-INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OAI-PMH:AutoUpdateSets','0','Automatically update OAI sets when a bibliographic record is created or updated','','YesNo'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index b014808..f96b3fc 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -4942,10 +4942,44 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > > $DBversion = "3.07.00.029"; > if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { >- my $installer = C4::Installer->new(); >- my $full_path = C4::Context->config('intranetdir') . "/installer/data/$installer->{dbms}/atomicupdate/oai_sets.sql"; >- my $error = $installer->load_sql($full_path); >- warn $error if $error; >+ $dbh->do(qq{ >+DROP TABLE IF EXISTS `oai_sets_descriptions`; >+DROP TABLE IF EXISTS `oai_sets_mappings`; >+DROP TABLE IF EXISTS `oai_sets_biblios`; >+DROP TABLE IF EXISTS `oai_sets`; >+ >+CREATE TABLE `oai_sets` ( >+ `id` int(11) NOT NULL auto_increment, >+ `spec` varchar(80) NOT NULL UNIQUE, >+ `name` varchar(80) NOT NULL, >+ PRIMARY KEY (`id`) >+) ENGINE=InnoDB DEFAULT CHARSET=utf8; >+ >+CREATE TABLE `oai_sets_descriptions` ( >+ `set_id` int(11) NOT NULL, >+ `description` varchar(255) NOT NULL, >+ CONSTRAINT `oai_sets_descriptions_ibfk_1` FOREIGN KEY (`set_id`) REFERENCES `oai_sets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE >+) ENGINE=InnoDB DEFAULT CHARSET=utf8; >+ >+CREATE TABLE `oai_sets_mappings` ( >+ `set_id` int(11) NOT NULL, >+ `marcfield` char(3) NOT NULL, >+ `marcsubfield` char(1) NOT NULL, >+ `marcvalue` varchar(80) NOT NULL, >+ CONSTRAINT `oai_sets_mappings_ibfk_1` FOREIGN KEY (`set_id`) REFERENCES `oai_sets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE >+) ENGINE=InnoDB DEFAULT CHARSET=utf8; >+ >+CREATE TABLE `oai_sets_biblios` ( >+ `biblionumber` int(11) NOT NULL, >+ `set_id` int(11) NOT NULL, >+ PRIMARY KEY (`biblionumber`, `set_id`), >+ CONSTRAINT `oai_sets_biblios_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE, >+ CONSTRAINT `oai_sets_biblios_ibfk_2` FOREIGN KEY (`set_id`) REFERENCES `oai_sets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE >+) ENGINE=InnoDB DEFAULT CHARSET=utf8; >+ >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OAI-PMH:AutoUpdateSets','0','Automatically update OAI sets when a bibliographic record is created or updated','','YesNo'); >+ >+}); > print "Upgrade to $DBversion done (Atomic update for OAI-PMH sets management)\n"; > SetVersion($DBversion); > } >@@ -9877,9 +9911,9 @@ 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 >+ print "DEV atomic update : $_ \n"; >+ my $installer = C4::Installer->new(); >+ my $rv = $installer->load_sql( C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/' . $_ )? 0: 1; > } > > >-- >1.7.2.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 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