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

(-)a/Koha/Schema/Result/OldReserve.pm (-4 / +4 lines)
Lines 137-143 __PACKAGE__->table("old_reserves"); Link Here
137
  is_nullable: 1
137
  is_nullable: 1
138
  size: 10
138
  size: 10
139
139
140
=head2 item_level_hold
140
=head2 item_level
141
141
142
  data_type: 'tinyint'
142
  data_type: 'tinyint'
143
  default_value: 0
143
  default_value: 0
Lines 198-204 __PACKAGE__->add_columns( Link Here
198
  },
198
  },
199
  "itemtype",
199
  "itemtype",
200
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
200
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
201
  "item_level_hold",
201
  "item_level",
202
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
202
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
203
);
203
);
204
204
Lines 297-304 __PACKAGE__->belongs_to( Link Here
297
);
297
);
298
298
299
299
300
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-06-17 07:24:39
300
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-06-17 15:35:57
301
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZgGAW7ODBby3hGNJ41eeMA
301
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rQMv2lyDOGwH9gDqrzLdmA
302
302
303
303
304
# You can replace this text with custom content, and it will be preserved on regeneration
304
# You can replace this text with custom content, and it will be preserved on regeneration
(-)a/Koha/Schema/Result/Reserve.pm (-7 / +7 lines)
Lines 141-147 __PACKAGE__->table("reserves"); Link Here
141
  is_nullable: 1
141
  is_nullable: 1
142
  size: 10
142
  size: 10
143
143
144
=head2 item_level_hold
144
=head2 item_level
145
145
146
  data_type: 'tinyint'
146
  data_type: 'tinyint'
147
  default_value: 0
147
  default_value: 0
Lines 212-218 __PACKAGE__->add_columns( Link Here
212
  },
212
  },
213
  "itemtype",
213
  "itemtype",
214
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
214
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
215
  "item_level_hold",
215
  "item_level",
216
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
216
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
217
);
217
);
218
218
Lines 321-328 __PACKAGE__->belongs_to( Link Here
321
);
321
);
322
322
323
323
324
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-06-17 07:24:39
324
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-06-17 15:35:57
325
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OMFqEWyKqFTcYj7vAFXy/g
325
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5rdCr4lZTl6JUrJ/LujZQA
326
326
327
__PACKAGE__->belongs_to(
327
__PACKAGE__->belongs_to(
328
  "item",
328
  "item",
Lines 349-357 __PACKAGE__->belongs_to( Link Here
349
);
349
);
350
350
351
__PACKAGE__->add_columns(
351
__PACKAGE__->add_columns(
352
    '+item_level_hold' => { is_boolean => 1 },
352
    '+item_level'     => { is_boolean => 1 },
353
    '+lowestPriority'  => { is_boolean => 1 },
353
    '+lowestPriority' => { is_boolean => 1 },
354
    '+suspend'         => { is_boolean => 1 }
354
    '+suspend'        => { is_boolean => 1 }
355
);
355
);
356
356
357
1;
357
1;
(-)a/installer/data/mysql/atomicupdate/bug_23133_item_level_holds.perl (+19 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
4
    if ( column_exists( 'reserves', 'item_level_hold' ) ) {
5
        $dbh->do(q{
6
            ALTER TABLE reserves
7
                CHANGE COLUMN `item_level_hold` `item_level` TINYINT(1) NOT NULL DEFAULT 0;
8
        });
9
    }
10
    if ( column_exists( 'old_reserves', 'item_level_hold' ) ) {
11
        $dbh->do(q{
12
            ALTER TABLE old_reserves
13
                CHANGE COLUMN `item_level_hold` `item_level` TINYINT(1) NOT NULL DEFAULT 0;
14
        });
15
    }
16
17
    SetVersion( $DBversion );
18
    print "Upgrade to $DBversion done (Bug 23133 - Rename reserves.item_level_hold for reserves.item_level)\n";
19
}
(-)a/installer/data/mysql/kohastructure.sql (-3 / +2 lines)
Lines 1882-1888 CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha Link Here
1882
  `suspend` BOOLEAN NOT NULL DEFAULT 0,
1882
  `suspend` BOOLEAN NOT NULL DEFAULT 0,
1883
  `suspend_until` DATETIME NULL DEFAULT NULL,
1883
  `suspend_until` DATETIME NULL DEFAULT NULL,
1884
  `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting
1884
  `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting
1885
  `item_level_hold` BOOLEAN NOT NULL DEFAULT 0, -- Is the hpld placed at item level
1885
  `item_level` TINYINT(1) NOT NULL DEFAULT 0, -- Is the hold placed at item level
1886
  PRIMARY KEY (`reserve_id`),
1886
  PRIMARY KEY (`reserve_id`),
1887
  KEY priorityfoundidx (priority,found),
1887
  KEY priorityfoundidx (priority,found),
1888
  KEY `borrowernumber` (`borrowernumber`),
1888
  KEY `borrowernumber` (`borrowernumber`),
Lines 1922-1928 CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b Link Here
1922
  `suspend` BOOLEAN NOT NULL DEFAULT 0, -- in this hold suspended (1 for yes, 0 for no)
1922
  `suspend` BOOLEAN NOT NULL DEFAULT 0, -- in this hold suspended (1 for yes, 0 for no)
1923
  `suspend_until` DATETIME NULL DEFAULT NULL, -- the date this hold is suspended until (NULL for infinitely)
1923
  `suspend_until` DATETIME NULL DEFAULT NULL, -- the date this hold is suspended until (NULL for infinitely)
1924
  `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting
1924
  `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting
1925
  `item_level_hold` BOOLEAN NOT NULL DEFAULT 0, -- Is the hpld placed at item level
1925
  `item_level` TINYINT(1) NOT NULL DEFAULT 0, -- Is the hold placed at item level
1926
  PRIMARY KEY (`reserve_id`),
1926
  PRIMARY KEY (`reserve_id`),
1927
  KEY `old_reserves_borrowernumber` (`borrowernumber`),
1927
  KEY `old_reserves_borrowernumber` (`borrowernumber`),
1928
  KEY `old_reserves_biblionumber` (`biblionumber`),
1928
  KEY `old_reserves_biblionumber` (`biblionumber`),
1929
- 

Return to bug 23133