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

(-)a/installer/data/mysql/atomicupdate/bug_16122_atomicupdate.pl (+31 lines)
Line 0 Link Here
1
use Modern::Perl;
2
return {
3
    bug_number  => "16122",
4
    description => "Add localuse column to items table and deleted items table",
5
    up          => sub {
6
        my ($args) = @_;
7
        my ( $dbh, $out ) = @$args{qw(dbh out)};
8
        if ( !column_exists( 'items', 'localuse' ) ) {
9
            $dbh->do(
10
                q{
11
                ALTER TABLE items
12
                ADD COLUMN localuse smallint(6) NULL DEFAULT NULL
13
                COMMENT "item's local use count"
14
                AFTER renewals
15
            }
16
            );
17
            say $out "Added column 'items.localuse'";
18
        }
19
        if ( !column_exists( 'deleteditems', 'localuse' ) ) {
20
            $dbh->do(
21
                q{
22
                ALTER TABLE deleteditems
23
                ADD COLUMN localuse smallint(6) NULL DEFAULT NULL
24
                COMMENT "deleteditems local use count"
25
                AFTER renewals
26
            }
27
            );
28
            say $out "Added column 'deleteditems.localuse'";
29
        }
30
    },
31
    }
(-)a/installer/data/mysql/kohastructure.sql (-1 / +2 lines)
Lines 2759-2764 CREATE TABLE `deleteditems` ( Link Here
2759
  `coded_location_qualifier` varchar(10) DEFAULT NULL COMMENT 'coded location qualifier(MARC21 952$f)',
2759
  `coded_location_qualifier` varchar(10) DEFAULT NULL COMMENT 'coded location qualifier(MARC21 952$f)',
2760
  `issues` smallint(6) DEFAULT 0 COMMENT 'number of times this item has been checked out',
2760
  `issues` smallint(6) DEFAULT 0 COMMENT 'number of times this item has been checked out',
2761
  `renewals` smallint(6) DEFAULT NULL COMMENT 'number of times this item has been renewed',
2761
  `renewals` smallint(6) DEFAULT NULL COMMENT 'number of times this item has been renewed',
2762
  `localuse` smallint(6) DEFAULT NULL COMMENT 'number of times this item has been recorded as localuse',
2762
  `reserves` smallint(6) DEFAULT NULL COMMENT 'number of times this item has been placed on hold/reserved',
2763
  `reserves` smallint(6) DEFAULT NULL COMMENT 'number of times this item has been placed on hold/reserved',
2763
  `restricted` tinyint(1) DEFAULT NULL COMMENT 'authorized value defining use restrictions for this item (MARC21 952$5)',
2764
  `restricted` tinyint(1) DEFAULT NULL COMMENT 'authorized value defining use restrictions for this item (MARC21 952$5)',
2764
  `itemnotes` longtext DEFAULT NULL COMMENT 'public notes on this item (MARC21 952$z)',
2765
  `itemnotes` longtext DEFAULT NULL COMMENT 'public notes on this item (MARC21 952$z)',
Lines 4016-4021 CREATE TABLE `items` ( Link Here
4016
  `coded_location_qualifier` varchar(10) DEFAULT NULL COMMENT 'coded location qualifier(MARC21 952$f)',
4017
  `coded_location_qualifier` varchar(10) DEFAULT NULL COMMENT 'coded location qualifier(MARC21 952$f)',
4017
  `issues` smallint(6) DEFAULT 0 COMMENT 'number of times this item has been checked out/issued',
4018
  `issues` smallint(6) DEFAULT 0 COMMENT 'number of times this item has been checked out/issued',
4018
  `renewals` smallint(6) DEFAULT NULL COMMENT 'number of times this item has been renewed',
4019
  `renewals` smallint(6) DEFAULT NULL COMMENT 'number of times this item has been renewed',
4020
  `localuse` smallint(6) DEFAULT NULL COMMENT 'number of times this item has been recorded as localuse',
4019
  `reserves` smallint(6) DEFAULT NULL COMMENT 'number of times this item has been placed on hold/reserved',
4021
  `reserves` smallint(6) DEFAULT NULL COMMENT 'number of times this item has been placed on hold/reserved',
4020
  `restricted` tinyint(1) DEFAULT NULL COMMENT 'authorized value defining use restrictions for this item (MARC21 952$5)',
4022
  `restricted` tinyint(1) DEFAULT NULL COMMENT 'authorized value defining use restrictions for this item (MARC21 952$5)',
4021
  `itemnotes` longtext DEFAULT NULL COMMENT 'public notes on this item (MARC21 952$z)',
4023
  `itemnotes` longtext DEFAULT NULL COMMENT 'public notes on this item (MARC21 952$z)',
4022
- 

Return to bug 16122