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

(-)a/installer/data/mysql/atomicupdate/bug_32485.pl (+27 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  => "32485",
6
    description => "Add new 'checkoutmsg' and 'checkoutmsgtype' columns to 'itemtypes'",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        if ( !column_exists( 'itemtypes', 'checkoutmsg' ) ) {
12
            $dbh->do(
13
                "ALTER TABLE itemtypes ADD COLUMN checkoutmsg VARCHAR(255) NULL DEFAULT NULL COMMENT 'message that is displayed when an item with the given item type is checked out' AFTER checkinmsgtype"
14
            );
15
        }
16
17
        say $out "Added column 'itemtypes.checkoutmsg'";
18
19
        if ( !column_exists( 'itemtypes', 'checkoutmsgtype' ) ) {
20
            $dbh->do(
21
                "ALTER TABLE itemtypes ADD COLUMN checkoutmsgtype CHAR(16) DEFAULT 'message' NOT NULL COMMENT 'Type (CSS class) for the checkoutmsg, can be ''alert'' or ''message''' AFTER checkoutmsg"
22
            );
23
        }
24
25
        say $out "Added column 'itemtypes.checkoutmsgtype'";
26
    },
27
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +2 lines)
Lines 4133-4138 CREATE TABLE `itemtypes` ( Link Here
4133
  `summary` mediumtext DEFAULT NULL COMMENT 'information from the summary field, may include HTML',
4133
  `summary` mediumtext DEFAULT NULL COMMENT 'information from the summary field, may include HTML',
4134
  `checkinmsg` varchar(255) DEFAULT NULL COMMENT 'message that is displayed when an item with the given item type is checked in',
4134
  `checkinmsg` varchar(255) DEFAULT NULL COMMENT 'message that is displayed when an item with the given item type is checked in',
4135
  `checkinmsgtype` char(16) NOT NULL DEFAULT 'message' COMMENT 'type (CSS class) for the checkinmsg, can be ''alert'' or ''message''',
4135
  `checkinmsgtype` char(16) NOT NULL DEFAULT 'message' COMMENT 'type (CSS class) for the checkinmsg, can be ''alert'' or ''message''',
4136
  `checkoutmsg` varchar(255) DEFAULT NULL COMMENT 'message that is displayed when an item with the given item type is checked out',
4137
  `checkoutmsgtype` char(16) NOT NULL DEFAULT 'message' COMMENT 'type (CSS class) for the checkoutmsg, can be ''alert'' or ''message''',
4136
  `sip_media_type` varchar(3) DEFAULT NULL COMMENT 'SIP2 protocol media type for this itemtype',
4138
  `sip_media_type` varchar(3) DEFAULT NULL COMMENT 'SIP2 protocol media type for this itemtype',
4137
  `hideinopac` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Hide the item type from the search options in OPAC',
4139
  `hideinopac` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Hide the item type from the search options in OPAC',
4138
  `searchcategory` varchar(80) DEFAULT NULL COMMENT 'Group this item type with others with the same value on OPAC search options',
4140
  `searchcategory` varchar(80) DEFAULT NULL COMMENT 'Group this item type with others with the same value on OPAC search options',
4139
- 

Return to bug 32485