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

(-)a/installer/data/mysql/atomicupdate/Bug22607_set_issues_renewals_default_to_zero.perl (+13 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
4
    $dbh->do( "UPDATE issues SET renewals = 0 WHERE renewals IS NULL" );
5
    $dbh->do( "UPDATE old_issues SET renewals = 0 WHERE renewals IS NULL" );
6
7
    $dbh->do( "ALTER TABLE issues MODIFY COLUMN renewals tinyint(4) NOT NULL default 0");
8
    $dbh->do( "ALTER TABLE old_issues MODIFY COLUMN renewals tinyint(4) NOT NULL default 0");
9
10
    # Always end with this (adjust the bug info)
11
    SetVersion( $DBversion );
12
    print "Upgrade to $DBversion done (Bug XXXXX - Set default value of issues.renewals to 0)\n";
13
}
(-)a/installer/data/mysql/kohastructure.sql (-3 / +2 lines)
Lines 1727-1733 CREATE TABLE `issues` ( -- information related to check outs or issues Link Here
1727
  `branchcode` varchar(10) default NULL, -- foreign key, linking to the branches table for the location the item was checked out
1727
  `branchcode` varchar(10) default NULL, -- foreign key, linking to the branches table for the location the item was checked out
1728
  `returndate` datetime default NULL, -- date the item was returned, will be NULL until moved to old_issues
1728
  `returndate` datetime default NULL, -- date the item was returned, will be NULL until moved to old_issues
1729
  `lastreneweddate` datetime default NULL, -- date the item was last renewed
1729
  `lastreneweddate` datetime default NULL, -- date the item was last renewed
1730
  `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
1730
  `renewals` tinyint(4) NOT NULL default 0, -- lists the number of times the item was renewed
1731
  `auto_renew` BOOLEAN default FALSE, -- automatic renewal
1731
  `auto_renew` BOOLEAN default FALSE, -- automatic renewal
1732
  `auto_renew_error` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, -- automatic renewal error
1732
  `auto_renew_error` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, -- automatic renewal error
1733
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1733
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
Lines 1759-1765 CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r Link Here
1759
  `branchcode` varchar(10) default NULL, -- foreign key, linking to the branches table for the location the item was checked out
1759
  `branchcode` varchar(10) default NULL, -- foreign key, linking to the branches table for the location the item was checked out
1760
  `returndate` datetime default NULL, -- date the item was returned
1760
  `returndate` datetime default NULL, -- date the item was returned
1761
  `lastreneweddate` datetime default NULL, -- date the item was last renewed
1761
  `lastreneweddate` datetime default NULL, -- date the item was last renewed
1762
  `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
1762
  `renewals` tinyint(4) NOT NULL default 0, -- lists the number of times the item was renewed
1763
  `auto_renew` BOOLEAN default FALSE, -- automatic renewal
1763
  `auto_renew` BOOLEAN default FALSE, -- automatic renewal
1764
  `auto_renew_error` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, -- automatic renewal error
1764
  `auto_renew_error` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, -- automatic renewal error
1765
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1765
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1766
- 

Return to bug 22607