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

(-)a/installer/data/mysql/atomicupdate/bug_33641.pl (+35 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_failure say_success say_info);
3
4
return {
5
    bug_number  => "33641",
6
    description => "Added issues.return_branch and old_issues.return_branch",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        if ( !column_exists( 'issues', 'return_branch' ) ) {
12
            $dbh->do(
13
                q{
14
                ALTER TABLE issues
15
                ADD COLUMN return_branch varchar(10) DEFAULT NULL
16
                COMMENT 'foreign key, linking to the branches table for the location the item was returned'
17
                AFTER returndate
18
             }
19
            );
20
            say_success( $out, "Added column 'issues.return_branch'" );
21
        }
22
        if ( !column_exists( 'old_issues', 'return_branch' ) ) {
23
            $dbh->do(
24
                q{
25
                ALTER TABLE old_issues
26
                ADD COLUMN return_branch varchar(10) DEFAULT NULL
27
                COMMENT 'foreign key, linking to the branches table for the location the item was returned'
28
                AFTER returndate
29
             }
30
            );
31
            say_success( $out, "Added column 'old_issues.return_branch'" );
32
        }
33
34
    },
35
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +2 lines)
Lines 3896-3901 CREATE TABLE `issues` ( Link Here
3896
  `date_due` datetime DEFAULT NULL COMMENT 'datetime the item is due (yyyy-mm-dd hh:mm::ss)',
3896
  `date_due` datetime DEFAULT NULL COMMENT 'datetime the item is due (yyyy-mm-dd hh:mm::ss)',
3897
  `branchcode` varchar(10) DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was checked out',
3897
  `branchcode` varchar(10) DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was checked out',
3898
  `returndate` datetime DEFAULT NULL COMMENT 'date the item was returned, will be NULL until moved to old_issues',
3898
  `returndate` datetime DEFAULT NULL COMMENT 'date the item was returned, will be NULL until moved to old_issues',
3899
  `return_branch` varchar(10) DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was returned',
3899
  `lastreneweddate` datetime DEFAULT NULL COMMENT 'date the item was last renewed',
3900
  `lastreneweddate` datetime DEFAULT NULL COMMENT 'date the item was last renewed',
3900
  `renewals_count` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of times the item was renewed',
3901
  `renewals_count` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of times the item was renewed',
3901
  `unseen_renewals` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of consecutive times the item was renewed without being seen',
3902
  `unseen_renewals` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of consecutive times the item was renewed without being seen',
Lines 4985-4990 CREATE TABLE `old_issues` ( Link Here
4985
  `date_due` datetime DEFAULT NULL COMMENT 'date the item is due (yyyy-mm-dd)',
4986
  `date_due` datetime DEFAULT NULL COMMENT 'date the item is due (yyyy-mm-dd)',
4986
  `branchcode` varchar(10) DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was checked out',
4987
  `branchcode` varchar(10) DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was checked out',
4987
  `returndate` datetime DEFAULT NULL COMMENT 'date the item was returned',
4988
  `returndate` datetime DEFAULT NULL COMMENT 'date the item was returned',
4989
  `return_branch` varchar(10) DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was returned',
4988
  `lastreneweddate` datetime DEFAULT NULL COMMENT 'date the item was last renewed',
4990
  `lastreneweddate` datetime DEFAULT NULL COMMENT 'date the item was last renewed',
4989
  `renewals_count` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of times the item was renewed',
4991
  `renewals_count` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of times the item was renewed',
4990
  `unseen_renewals` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of consecutive times the item was renewed without being seen',
4992
  `unseen_renewals` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of consecutive times the item was renewed without being seen',
4991
- 

Return to bug 33641