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 3879-3884 CREATE TABLE `issues` ( Link Here
3879
  `date_due` datetime DEFAULT NULL COMMENT 'datetime the item is due (yyyy-mm-dd hh:mm::ss)',
3879
  `date_due` datetime DEFAULT NULL COMMENT 'datetime the item is due (yyyy-mm-dd hh:mm::ss)',
3880
  `branchcode` varchar(10) DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was checked out',
3880
  `branchcode` varchar(10) DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was checked out',
3881
  `returndate` datetime DEFAULT NULL COMMENT 'date the item was returned, will be NULL until moved to old_issues',
3881
  `returndate` datetime DEFAULT NULL COMMENT 'date the item was returned, will be NULL until moved to old_issues',
3882
  `return_branch` varchar(10) DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was returned',
3882
  `lastreneweddate` datetime DEFAULT NULL COMMENT 'date the item was last renewed',
3883
  `lastreneweddate` datetime DEFAULT NULL COMMENT 'date the item was last renewed',
3883
  `renewals_count` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of times the item was renewed',
3884
  `renewals_count` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of times the item was renewed',
3884
  `unseen_renewals` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of consecutive times the item was renewed without being seen',
3885
  `unseen_renewals` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of consecutive times the item was renewed without being seen',
Lines 4881-4886 CREATE TABLE `old_issues` ( Link Here
4881
  `date_due` datetime DEFAULT NULL COMMENT 'date the item is due (yyyy-mm-dd)',
4882
  `date_due` datetime DEFAULT NULL COMMENT 'date the item is due (yyyy-mm-dd)',
4882
  `branchcode` varchar(10) DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was checked out',
4883
  `branchcode` varchar(10) DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was checked out',
4883
  `returndate` datetime DEFAULT NULL COMMENT 'date the item was returned',
4884
  `returndate` datetime DEFAULT NULL COMMENT 'date the item was returned',
4885
  `return_branch` varchar(10) DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was returned',
4884
  `lastreneweddate` datetime DEFAULT NULL COMMENT 'date the item was last renewed',
4886
  `lastreneweddate` datetime DEFAULT NULL COMMENT 'date the item was last renewed',
4885
  `renewals_count` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of times the item was renewed',
4887
  `renewals_count` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of times the item was renewed',
4886
  `unseen_renewals` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of consecutive times the item was renewed without being seen',
4888
  `unseen_renewals` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of consecutive times the item was renewed without being seen',
4887
- 

Return to bug 33641