View | Details | Raw Unified | Return to bug 9988
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_9988b_table.perl (+14 lines)
Line 0 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(
4
q|ALTER TABLE need_merge_authorities
5
ADD COLUMN authid_new BIGINT AFTER authid,
6
ADD COLUMN reportxml text AFTER authid_new,
7
ADD COLUMN timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;|
8
    );
9
10
    $dbh->do( q|UPDATE need_merge_authorities SET authid_new=authid WHERE done<>1| );
11
12
    SetVersion( $DBversion );
13
    print "Upgrade to $DBversion done (Bug 9988 - Alter table need_merge_authorities)\n";
14
}
(-)a/installer/data/mysql/kohastructure.sql (-4 / +8 lines)
Lines 1255-1264 CREATE TABLE `matchchecks` ( Link Here
1255
--
1255
--
1256
1256
1257
DROP TABLE IF EXISTS `need_merge_authorities`;
1257
DROP TABLE IF EXISTS `need_merge_authorities`;
1258
CREATE TABLE `need_merge_authorities` ( -- keeping track of authority records still to be merged by merge_authority cron job (used only if pref dontmerge is ON)
1258
CREATE TABLE `need_merge_authorities` ( -- keeping track of authority records still to be merged by merge_authority cron job
1259
  `id` int NOT NULL auto_increment PRIMARY KEY, -- unique id
1259
  `id` int NOT NULL auto_increment PRIMARY KEY, -- unique id
1260
  `authid` bigint NOT NULL, -- reference to authority record
1260
  `authid` bigint NOT NULL, -- reference to original authority record
1261
  `done` tinyint DEFAULT 0  -- indication whether merge has been executed (0=not done, 1= done, 2= in progress)
1261
  `authid_new` bigint, -- reference to optional new authority record
1262
  `reportxml` text, -- xml showing original reporting tag
1263
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- date and time last modified
1264
  `done` tinyint DEFAULT 0  -- indication whether merge has been executed (0=not done, 1=done, 2=in progress)
1265
-- Note: authid and authid_new should NOT be FOREIGN keys !
1266
-- authid may have been deleted; authid_new may be zero
1262
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1267
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1263
1268
1264
--
1269
--
1265
- 

Return to bug 9988