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

(-)a/installer/data/mysql/atomicupdate/0001-bug_2929-permit_to_define_fine_days_in_issuing_rules.pl (-22 lines)
Lines 1-22 Link Here
1
#! /usr/bin/perl
2
use strict;
3
use warnings;
4
use C4::Context;
5
my $dbh=C4::Context->dbh;
6
$dbh->do("ALTER TABLE issuingrules ADD 
7
		COLUMN `finedays` int(11) default NULL AFTER `fine`,
8
		COLUMN `renewalsallowed` smallint(6) default NULL, 
9
		COLUMN `reservesallowed` smallint(6) default NULL,
10
		");
11
my $sth = $dbh->prepare("SELECT itemtype, renewalsallowed FROM itemtypes");
12
$sth->execute();
13
14
my $sthupd = $dbh->prepare("UPDATE issuingrules SET renewalsallowed = ? WHERE itemtype = ?");
15
    
16
while(my $row = $sth->fetchrow_hashref){
17
      $sthupd->execute($row->{renewalsallowed}, $row->{itemtype});
18
}
19
    
20
$dbh->do('ALTER TABLE itemtypes DROP COLUMN `renewalsallowed`;');
21
    
22
print "Upgrade done (Adding finedays renewalsallowed, and reservesallowed fields in issuingrules table)\n";
(-)a/installer/data/mysql/atomicupdate/0004-Add_Some_Missing_fields_to_suggestions.pl (-22 lines)
Lines 1-22 Link Here
1
#!/usr/bin/perl
2
use strict;
3
use warnings;
4
use C4::Context;
5
my $dbh=C4::Context->dbh;
6
$dbh->do(<<SUGGESTIONS);
7
ALTER table suggestions 
8
    ADD budgetid INT(11),
9
    ADD branchcode VARCHAR(10) default NULL,
10
    ADD acceptedby INT(11) default NULL,
11
    ADD acceptedon date default NULL,
12
    ADD suggestedon date default NULL,
13
    ADD managedon date default NULL,
14
    ADD rejectedby INT(11) default NULL,
15
    ADD rejectedon date default NULL,
16
    ADD collectiontitle text default NULL,
17
    ADD itemtype VARCHAR(30) default NULL,
18
    ADD sort1 VARCHAR(80) default NULL,
19
    ADD sort2 VARCHAR(80) default NULL
20
    ;
21
SUGGESTIONS
22
print "Add some fields to suggestions";
(-)a/installer/data/mysql/atomicupdate/0005-Add_CAS_Configuration.pl (-8 lines)
Lines 1-8 Link Here
1
#! /usr/bin/perl
2
use strict;
3
use warnings;
4
use C4::Context;
5
my $dbh=C4::Context->dbh;
6
7
$dbh->do("INSERT INTO `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('casAuthentication', '1', '', 'Enable or disable CAS authentication', 'YesNo'), ('casLogout', '1', '', 'Does a logout from Koha should also log out of CAS ?', 'YesNo'), ('casServerUrl', 'https://localhost:8443/cas', '', 'URL of the cas server', 'Free')");
8
print "Upgrade done (added CAS authentication system preferences)\n";
(-)a/installer/data/mysql/atomicupdate/0007-Opac-search-history.pl (-24 lines)
Lines 1-24 Link Here
1
#! /usr/bin/perl
2
use strict;
3
use warnings;
4
use C4::Context;
5
my $dbh=C4::Context->dbh;
6
7
$dbh->do("INSERT INTO `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('EnableOpacSearchHistory', '1', '', 'Enable or disable opac search history', 'YesNo')");
8
9
my $create = <<END;
10
CREATE TABLE IF NOT EXISTS `search_history` (
11
  `userid` int(11) NOT NULL,
12
  `sessionid` varchar(32) NOT NULL,
13
  `query_desc` varchar(255) NOT NULL,
14
  `query_cgi` varchar(255) NOT NULL,
15
  `total` int(11) NOT NULL,
16
  `time` timestamp NOT NULL default CURRENT_TIMESTAMP,
17
  KEY `userid` (`userid`),
18
  KEY `sessionid` (`sessionid`)
19
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Opac search history results';
20
END
21
22
$dbh->do($create);
23
24
print "Upgrade done (added OPAC search history preference and table)\n";
(-)a/installer/data/mysql/atomicupdate/0008-opac-description-for-authorised-values.pl (-7 lines)
Lines 1-7 Link Here
1
#! /usr/bin/perl
2
use strict;
3
use warnings;
4
use C4::Context;
5
my $dbh=C4::Context->dbh;
6
$dbh->do("ALTER TABLE authorised_values ADD COLUMN `lib_opac` VARCHAR(80) default NULL AFTER `lib`");
7
print "Upgrade done (Added a lib_opac field in authorised_values table)\n";
(-)a/installer/data/mysql/atomicupdate/0009-patron-attr-display-checkout.pl (-7 lines)
Lines 1-7 Link Here
1
#! /usr/bin/perl
2
use strict;
3
use warnings;
4
use C4::Context;
5
my $dbh=C4::Context->dbh;
6
$dbh->do("ALTER TABLE borrower_attribute_types ADD COLUMN `display_checkout` TINYINT(1) NOT NULL DEFAULT '0';");
7
print "Upgrade done (Added a display_checkout field in borrower_attribute_types table)\n";
(-)a/installer/data/mysql/atomicupdate/bug_6843_Renew_membership_from_expiry_or_current_date.pl (-9 lines)
Lines 1-9 Link Here
1
#! /usr/bin/perl
2
use strict;
3
use warnings;
4
use C4::Context;
5
my $dbh=C4::Context->dbh;
6
$dbh->do(<<ENDOFRENEWAL);
7
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('BorrowerRenewalPeriodBase', 'now', 'Set whether the borrower renewal date should be counted from the dateexpiry or from the current date ','dateexpiry|now','Choice');
8
ENDOFRENEWAL
9
print "Upgrade done (Added a system preference to allow renewal of Patron account either from todays date or from existing expiry date in the patrons account.)\n";
(-)a/installer/data/mysql/atomicupdate/bug_7144-add-returnbranch-to-branch-item-issuing-rules.pl (-20 lines)
Lines 1-20 Link Here
1
#! /usr/bin/perl
2
use strict;
3
use warnings;
4
use C4::Context;
5
my $dbh=C4::Context->dbh;
6
7
$dbh->do("ALTER TABLE default_circ_rules ADD
8
		COLUMN `returnbranch` varchar(15) default NULL AFTER `holdallowed`");
9
$dbh->do("ALTER TABLE branch_item_rules ADD
10
		COLUMN `returnbranch` varchar(15) default NULL AFTER `holdallowed`");
11
$dbh->do("ALTER TABLE default_branch_circ_rules ADD
12
		COLUMN `returnbranch` varchar(15) default NULL AFTER `holdallowed`");
13
$dbh->do("ALTER TABLE default_branch_item_rules ADD
14
		COLUMN `returnbranch` varchar(15) default NULL AFTER `holdallowed`");
15
16
# set the default rule to the current value of HomeOrHoldingBranchReturn (default to 'homebranch' if need be)
17
my $homeorholdingbranchreturn = C4::Context->prefernce('HomeOrHoldingBranchReturn') || 'homebranch';
18
$dbh->do("UPDATE default_circ_rules SET returnbranch = '$homeorholdingbranchreturn'");
19
20
print "Upgrade done (Adding 'returnbranch' to branch/item issuing rules tables)\n";
(-)a/installer/data/mysql/atomicupdate/bug_7284_authority_linking_pt1 (-21 lines)
Lines 1-21 Link Here
1
#! /usr/bin/perl
2
use strict;
3
use warnings;
4
use C4::Context;
5
my $dbh = C4::Context->dbh;
6
$dbh->do(
7
"INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('LinkerModule','Default','Chooses which linker module to use (see documentation).','Default|FirstMatchLastMatch','Choice');"
8
);
9
$dbh->do(
10
"INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('LinkerOptions','','A pipe-separated list of options for the linker.','','free');"
11
);
12
$dbh->do(
13
"INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('LinkerRelink',1,'If ON the authority linker will relink headings that have previously been linked every time it runs.',NULL,'YesNo');"
14
);
15
$dbh->do(
16
"INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('LinkerKeepStale',0,'If ON the authority linker will keep existing authority links for headings where it is unable to find a match.',NULL,'YesNo');"
17
);
18
$dbh->do(
19
"INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AutoCreateAuthorities',0,'Automatically create authorities that do not exist when cataloging records.',NULL,'YesNo');"
20
);
21
print "Upgrade done (Configured bug 7284, improved authority matching)\n";
(-)a/installer/data/mysql/atomicupdate/bug_7284_authority_linking_pt2 (-9 lines)
Lines 1-9 Link Here
1
#! /usr/bin/perl
2
use strict;
3
use warnings;
4
use C4::Context;
5
my $dbh = C4::Context->dbh;
6
$dbh->do(
7
"INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogModuleRelink',0,'If OFF the linker will never replace the authids that are set in the cataloging module.',NULL,'YesNo');"
8
);
9
print "Upgrade done (Configured bug 7284, added the )\n";
(-)a/installer/data/mysql/atomicupdate/hourlyloans.sql (-1 lines)
Line 1 Link Here
1
alter table issuingrules add column lengthunit varchar(10) default 'days' after issuelength;
(-)a/installer/data/mysql/atomicupdate/importauthorities.pl (-26 lines)
Lines 1-26 Link Here
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";
(-)a/installer/data/mysql/atomicupdate/issuedate_times.pl (-17 lines)
Lines 1-17 Link Here
1
#!/usr/bin/perl
2
3
use strict;
4
use warnings;
5
use C4::Context;
6
7
my $dbh = C4::Context->dbh;
8
9
$dbh->do("ALTER TABLE issues CHANGE date_due date_due datetime");
10
$dbh->do("ALTER TABLE issues CHANGE returndate returndate datetime");
11
$dbh->do("ALTER TABLE issues CHANGE lastreneweddate lastreneweddate datetime");
12
$dbh->do("ALTER TABLE issues CHANGE issuedate issuedate datetime");
13
$dbh->do("ALTER TABLE old_issues CHANGE date_due date_due datetime");
14
$dbh->do("ALTER TABLE old_issues CHANGE returndate returndate datetime");
15
$dbh->do("ALTER TABLE old_issues CHANGE lastreneweddate lastreneweddate datetime");
16
$dbh->do("ALTER TABLE old_issues CHANGE issuedate issuedate datetime");
17
$dbh->do(q{update issues set date_due = addtime(date_due, '0 23:0:0') where hour(date_due) = 0});
(-)a/installer/data/mysql/atomicupdate/local_cover_images.pl (-30 lines)
Lines 1-30 Link Here
1
#! /usr/bin/perl
2
use strict;
3
use warnings;
4
use C4::Context;
5
my $dbh = C4::Context->dbh;
6
7
$dbh->do(
8
    q|CREATE TABLE `biblioimages` (
9
      `imagenumber` int(11) NOT NULL AUTO_INCREMENT,
10
      `biblionumber` int(11) NOT NULL,
11
      `mimetype` varchar(15) NOT NULL,
12
      `imagefile` mediumblob NOT NULL,
13
      `thumbnail` mediumblob NOT NULL,
14
      PRIMARY KEY (`imagenumber`),
15
      CONSTRAINT `bibliocoverimage_fk1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
16
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8|
17
);
18
$dbh->do(
19
q|INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACLocalCoverImages','0','Display local cover images on OPAC search and details pages.','1','YesNo')|
20
);
21
$dbh->do(
22
q|INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('LocalCoverImages','0','Display local cover images on intranet search and details pages.','1','YesNo')|
23
);
24
$dbh->do(
25
q|INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowMultipleCovers','0','Allow multiple cover images to be attached to each bibliographic record.','1','YesNo')|
26
);
27
$dbh->do(
28
q|INSERT INTO permissions (module_bit, code, description) VALUES (13, 'upload_local_cover_images', 'Upload local cover images')|
29
);
30
print "Upgrade done (Added support for local cover images)\n";
(-)a/installer/data/mysql/atomicupdate/subscription_add_enddate.pl (-10 lines)
Lines 1-9 Link Here
1
#!/usr/bin/perl
2
#use strict;
3
#use warnings; FIXME - Bug 2505
4
use C4::Context;
5
my $dbh=C4::Context->dbh;
6
$dbh->do("ALTER TABLE `subscription` ADD `enddate` date default NULL");
7
$dbh->do("ALTER TABLE subscriptionhistory CHANGE enddate histenddate DATE default NULL");
8
print "Upgrade to $DBversion done ( Adding enddate to subscription)\n";
9
10
- 

Return to bug 13068