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

(-)a/installer/data/mysql/atomicupdate/bug_19316-addsort1-and-sort2-to-items.pl (+43 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "19316",
5
    description => "Add sort1 and sort2 fields to items",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        if ( !column_exists( 'items', 'sort1' ) ) {
11
            $dbh->do(
12
                q{
13
                ALTER TABLE `items` ADD COLUMN `sort1` varchar(50) default NULL AFTER `exclude_from_local_holds_priority`
14
            }
15
            );
16
            say $out "Added column 'items.sort1'";
17
        }
18
        if ( !column_exists( 'items', 'sort2' ) ) {
19
            $dbh->do(
20
                q{
21
                ALTER TABLE `items` ADD COLUMN `sort2` varchar(50) default NULL AFTER `sort1`
22
            }
23
            );
24
            say $out "Added column 'items.sort2'";
25
        }
26
        if ( !column_exists( 'deleteditems', 'sort1' ) ) {
27
            $dbh->do(
28
                q{
29
                ALTER TABLE `deleteditems` ADD COLUMN `sort1` varchar(50) default NULL AFTER `exclude_from_local_holds_priority`
30
            }
31
            );
32
            say $out "Added column 'deleteditems.sort1'";
33
        }
34
        if ( !column_exists( 'deleteditems', 'sort2' ) ) {
35
            $dbh->do(
36
                q{
37
                ALTER TABLE `deleteditems` ADD COLUMN `sort2` varchar(50) default NULL AFTER `sort1`
38
            }
39
            );
40
            say $out "Added column 'deleteditems.sort2'";
41
        }
42
    }
43
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +4 lines)
Lines 2797-2802 CREATE TABLE `deleteditems` ( Link Here
2797
  `stocknumber` varchar(32) DEFAULT NULL COMMENT 'inventory number (MARC21 952$i)',
2797
  `stocknumber` varchar(32) DEFAULT NULL COMMENT 'inventory number (MARC21 952$i)',
2798
  `new_status` varchar(32) DEFAULT NULL COMMENT '''new'' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.',
2798
  `new_status` varchar(32) DEFAULT NULL COMMENT '''new'' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.',
2799
  `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude this item from local holds priority',
2799
  `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude this item from local holds priority',
2800
  `sort1` varchar(50) default NULL,
2801
  `sort2` varchar(50) default NULL,
2800
  PRIMARY KEY (`itemnumber`),
2802
  PRIMARY KEY (`itemnumber`),
2801
  KEY `delitembarcodeidx` (`barcode`),
2803
  KEY `delitembarcodeidx` (`barcode`),
2802
  KEY `delitemstocknumberidx` (`stocknumber`),
2804
  KEY `delitemstocknumberidx` (`stocknumber`),
Lines 4055-4060 CREATE TABLE `items` ( Link Here
4055
  `stocknumber` varchar(32) DEFAULT NULL COMMENT 'inventory number (MARC21 952$i)',
4057
  `stocknumber` varchar(32) DEFAULT NULL COMMENT 'inventory number (MARC21 952$i)',
4056
  `new_status` varchar(32) DEFAULT NULL COMMENT '''new'' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.',
4058
  `new_status` varchar(32) DEFAULT NULL COMMENT '''new'' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.',
4057
  `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude this item from local holds priority',
4059
  `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude this item from local holds priority',
4060
  `sort1` varchar(50) default NULL,
4061
  `sort2` varchar(50) default NULL,
4058
  PRIMARY KEY (`itemnumber`),
4062
  PRIMARY KEY (`itemnumber`),
4059
  UNIQUE KEY `itembarcodeidx` (`barcode`),
4063
  UNIQUE KEY `itembarcodeidx` (`barcode`),
4060
  KEY `itemstocknumberidx` (`stocknumber`),
4064
  KEY `itemstocknumberidx` (`stocknumber`),
4061
- 

Return to bug 19316