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

(-)a/installer/data/mysql/atomicupdate/bug9988b_table.perl (+15 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
CHANGE COLUMN authid authid_from BIGINT NOT NULL,
6
ADD COLUMN authid_to BIGINT NOT NULL AFTER authid_from,
7
ADD COLUMN reportxml text AFTER authid_to;|
8
    );
9
10
    $dbh->do( q|UPDATE need_merge_authorities SET authid_to=authid_from| );
11
12
    # Always end with this (adjust the bug info)
13
    SetVersion( $DBversion );
14
    print "Upgrade to $DBversion done (Bug 9988 - Alter table need_merge_authorities)\n";
15
}
(-)a/installer/data/mysql/kohastructure.sql (-4 / +7 lines)
Lines 1252-1261 CREATE TABLE `matchchecks` ( Link Here
1252
--
1252
--
1253
1253
1254
DROP TABLE IF EXISTS `need_merge_authorities`;
1254
DROP TABLE IF EXISTS `need_merge_authorities`;
1255
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)
1255
CREATE TABLE `need_merge_authorities` ( -- keeping track of authority records still to be merged by merge_authority cron job
1256
  `id` int NOT NULL auto_increment PRIMARY KEY, -- unique id
1256
  `id` int NOT NULL auto_increment PRIMARY KEY, -- unique id
1257
  `authid` bigint NOT NULL, -- reference to authority record
1257
  `authid_from` bigint NOT NULL, -- reference to original authority record
1258
  `done` tinyint DEFAULT 0  -- indication whether merge has been executed (0=not done, 1= done, 2= in progress)
1258
  `authid_to` bigint NOT NULL, -- reference to new authority record
1259
  `reportxml` text, -- xml showing original reporting tag
1260
  `done` tinyint DEFAULT 0  -- indication whether merge has been executed (0=not done, 1= done, >1 in progress)
1261
-- Note: authid_from and authid_to should NOT be FOREIGN keys !
1262
-- authid_from may have been deleted; authid_to may be zero
1259
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1263
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1260
1264
1261
--
1265
--
1262
- 

Return to bug 9988