From 4f2ba168d019a542f30c7cfcfbc34abedbcbe010 Mon Sep 17 00:00:00 2001 From: Amit Gupta Date: Thu, 17 Oct 2013 22:08:07 +0530 Subject: [PATCH] Bug-10477-Alter table import_batches Added overlay_action to "appendmarctag" and new column "marctag" --- installer/data/mysql/kohastructure.sql | 3 ++- installer/data/mysql/updatedatabase.pl | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index a6a779e..eba7e84 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -968,7 +968,7 @@ CREATE TABLE `import_batches` ( -- information about batches of marc records tha `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 + `overlay_action` enum('replace', 'create_new', 'use_template', 'ignore','appendmarctag') NOT NULL default 'create_new', -- how to handle duplicate records `nomatch_action` enum('create_new', 'ignore') NOT NULL default 'create_new', -- how to handle records where no match is found `item_action` enum('always_add', 'add_only_for_matches', 'add_only_for_new', 'ignore', 'replace') 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 @@ -976,6 +976,7 @@ CREATE TABLE `import_batches` ( -- information about batches of marc records tha `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 + `marctag` mediumtext, -- marc tag for ex: 100a, 700a PRIMARY KEY (`import_batch_id`), KEY `branchcode` (`branchcode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 3d2ca44..5742925 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7595,6 +7595,13 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.13.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do("ALTER TABLE import_batches MODIFY overlay_action enum('replace', 'create_new', 'use_template', 'ignore', 'appendmarctag') NOT NULL default 'create_new'"); + $dbh->do("ALTER TABLE import_batches ADD COLUMN marctag mediumtext"); + print "Upgrade to $DBversion done (Bug 10477: Alter table import_batches )\n"; + SetVersion ($DBversion); +} =head1 FUNCTIONS -- 1.8.4.rc3