@@ -, +, @@ etc/zebradb/authorities/etc/bib1.att etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl misc/migration_tools/rebuild_zebra.pl -a -r -v --- etc/zebradb/authorities/etc/bib1.att | 1 + .../authorities/authority-koha-indexdefs.xml | 16 +++++++ .../authorities/authority-zebra-indexdefs.xsl | 44 ++++++++++++++++++++ etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl | 17 ++++++++ .../data/mysql/atomicupdate/importauthorities.pl | 26 ++++++++++++ installer/data/mysql/kohastructure.sql | 19 ++++++++- 6 files changed, 122 insertions(+), 1 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/importauthorities.pl --- a/etc/zebradb/authorities/etc/bib1.att +++ a/etc/zebradb/authorities/etc/bib1.att @@ -13,6 +13,7 @@ att 9042 Heading-use-subject-added-entry att 9043 Kind-of-record att 9046 Record-status att 9050 Subject-heading-thesaurus +att 9051 Previous-heading-see-from # Personal Name att 1 Personal-name --- a/etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml +++ a/etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml @@ -45,6 +45,19 @@ authority-zebra-indexdefs.xsl` Heading-use-series-added-entry:w + + + + LC-card-number:w + LC-card-number:p + + + + + Record-source:w + Record-source:p + + @@ -346,6 +359,9 @@ authority-zebra-indexdefs.xsl` See-from:p See-from:s + + Previous-heading-see-from:p + Match:w Match:p --- a/etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl +++ a/etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl @@ -13,6 +13,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) + @@ -35,6 +36,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) + @@ -69,6 +71,24 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) + + + + + + + + + + + + + + + + + + @@ -1102,6 +1122,30 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) + + + + + + + + + + -- + + + + + + + + + + + + + + --- a/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl +++ a/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl @@ -16,6 +16,7 @@ + @@ -33,6 +34,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) + @@ -54,6 +56,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) + @@ -64,6 +67,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) + @@ -279,6 +283,19 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) + + + + + + + + + + + + + --- a/installer/data/mysql/atomicupdate/importauthorities.pl +++ a/installer/data/mysql/atomicupdate/importauthorities.pl @@ -0,0 +1,26 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use C4::Context; +my $dbh = C4::Context->dbh; + +$dbh->do( +q|CREATE TABLE `import_auths` ( + import_record_id int(11) NOT NULL, + matched_authid int(11) default NULL, + control_number varchar(25) default NULL, + authorized_heading varchar(128) default NULL, + original_source varchar(25) default NULL, + CONSTRAINT import_auths_ibfk_1 FOREIGN KEY (import_record_id) + REFERENCES import_records (import_record_id) ON DELETE CASCADE ON UPDATE CASCADE, + KEY matched_authid (matched_authid) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8;| +); +$dbh->do("ALTER TABLE import_batches + CHANGE COLUMN num_biblios num_records int(11) NOT NULL default 0, + ADD COLUMN record_type enum('biblio', 'auth', 'holdings') NOT NULL default 'biblio'"); +$dbh->do("UPDATE import_batches SET record_type='auth' WHERE import_batch_id IN + (SELECT import_batch_id FROM import_records WHERE record_type='auth')"); + +print "Upgrade done (Added support for staging authorities)\n"; --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -853,7 +853,7 @@ CREATE TABLE `import_batches` ( -- information about batches of marc records tha `matcher_id` int(11) default NULL, -- the id of the match rule used (matchpoints.matcher_id) `template_id` int(11) default NULL, `branchcode` varchar(10) default NULL, - `num_biblios` int(11) NOT NULL default 0, -- number of bib records in the file + `num_records` int(11) NOT NULL default 0, -- number of records in the file `num_items` int(11) NOT NULL default 0, -- number of items in the file `upload_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, -- date and time the file was uploaded `overlay_action` enum('replace', 'create_new', 'use_template', 'ignore') NOT NULL default 'create_new', -- how to handle duplicate records @@ -861,6 +861,7 @@ CREATE TABLE `import_batches` ( -- information about batches of marc records tha `item_action` enum('always_add', 'add_only_for_matches', 'add_only_for_new', 'ignore') NOT NULL default 'always_add', -- what to do with item records `import_status` enum('staging', 'staged', 'importing', 'imported', 'reverting', 'reverted', 'cleaned') NOT NULL default 'staging', -- the status of the imported file `batch_type` enum('batch', 'z3950', 'webservice') NOT NULL default 'batch', -- where this batch has come from + `record_type` enum('biblio', 'auth', 'holdings') NOT NULL default 'biblio', -- type of record in the batch `file_name` varchar(100), -- the name of the file uploaded `comments` mediumtext, -- any comments added when the file was uploaded PRIMARY KEY (`import_batch_id`), @@ -909,6 +910,22 @@ CREATE TABLE `import_record_matches` ( -- matches found when importing a batch o ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- +-- Table structure for table `import_auths` +-- + +DROP TABLE IF EXISTS `import_auths`; +CREATE TABLE `import_auths` ( + `import_record_id` int(11) NOT NULL, + `matched_authid` int(11) default NULL, + `control_number` varchar(25) default NULL, + `authorized_heading` varchar(128) default NULL, + `original_source` varchar(25) default NULL, + CONSTRAINT `import_auths_ibfk_1` FOREIGN KEY (`import_record_id`) + REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE, + KEY `matched_authid` (`matched_authid`), +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- -- Table structure for table `import_biblios` -- --