Bug 9900 - Plugins should not be enabled by default
[koha.git] / installer / data / mysql / atomicupdate / importauthorities.pl
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use C4::Context;
6 my $dbh = C4::Context->dbh;
7
8 $dbh->do(
9 q|CREATE TABLE `import_auths` (
10     import_record_id int(11) NOT NULL,
11     matched_authid int(11) default NULL,
12     control_number varchar(25) default NULL,
13     authorized_heading varchar(128) default NULL,
14     original_source varchar(25) default NULL,
15     CONSTRAINT import_auths_ibfk_1 FOREIGN KEY (import_record_id)
16     REFERENCES import_records (import_record_id) ON DELETE CASCADE ON UPDATE CASCADE,
17     KEY matched_authid (matched_authid)
18     ) ENGINE=InnoDB DEFAULT CHARSET=utf8;|
19 );
20 $dbh->do("ALTER TABLE import_batches
21             CHANGE COLUMN num_biblios num_records int(11) NOT NULL default 0,
22             ADD COLUMN record_type enum('biblio', 'auth', 'holdings') NOT NULL default 'biblio'");
23 $dbh->do("UPDATE import_batches SET record_type='auth' WHERE import_batch_id IN
24             (SELECT import_batch_id FROM import_records WHERE record_type='auth')");
25
26 print "Upgrade done (Added support for staging authorities)\n";