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 2729-2734 CREATE TABLE `deleteditems` ( Link Here
2729
  `stocknumber` varchar(32) DEFAULT NULL COMMENT 'inventory number (MARC21 952$i)',
2729
  `stocknumber` varchar(32) DEFAULT NULL COMMENT 'inventory number (MARC21 952$i)',
2730
  `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.',
2730
  `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.',
2731
  `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude this item from local holds priority',
2731
  `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude this item from local holds priority',
2732
  `sort1` varchar(50) default NULL,
2733
  `sort2` varchar(50) default NULL,
2732
  PRIMARY KEY (`itemnumber`),
2734
  PRIMARY KEY (`itemnumber`),
2733
  KEY `delitembarcodeidx` (`barcode`),
2735
  KEY `delitembarcodeidx` (`barcode`),
2734
  KEY `delitemstocknumberidx` (`stocknumber`),
2736
  KEY `delitemstocknumberidx` (`stocknumber`),
Lines 3701-3706 CREATE TABLE `items` ( Link Here
3701
  `stocknumber` varchar(32) DEFAULT NULL COMMENT 'inventory number (MARC21 952$i)',
3703
  `stocknumber` varchar(32) DEFAULT NULL COMMENT 'inventory number (MARC21 952$i)',
3702
  `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.',
3704
  `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.',
3703
  `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude this item from local holds priority',
3705
  `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude this item from local holds priority',
3706
  `sort1` varchar(50) default NULL,
3707
  `sort2` varchar(50) default NULL,
3704
  PRIMARY KEY (`itemnumber`),
3708
  PRIMARY KEY (`itemnumber`),
3705
  UNIQUE KEY `itembarcodeidx` (`barcode`),
3709
  UNIQUE KEY `itembarcodeidx` (`barcode`),
3706
  KEY `itemstocknumberidx` (`stocknumber`),
3710
  KEY `itemstocknumberidx` (`stocknumber`),
3707
- 

Return to bug 19316