From 7dd76a08be2e820254f761d39713f42bdf3c64cf Mon Sep 17 00:00:00 2001 From: Amit Gupta Date: Mon, 24 Jun 2013 17:46:51 +0530 Subject: [PATCH 2/2] 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 | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index d7eebdd..5fedc5a 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -966,7 +966,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') 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 @@ -974,6 +974,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 5963d24..5bf0140 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7010,6 +7010,14 @@ CREATE TABLE IF NOT EXISTS borrower_files ( 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 =head2 TableExists($table) -- 1.7.9.5