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

(-)a/installer/data/mysql/atomicupdate/bug_24718_-_use_datetime_for_reserves.perl (+13 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    if( column_exists( 'reserves', 'reservedate' ) ) {
4
        $dbh->do(q{ALTER TABLE reserves MODIFY column reservedate datetime});
5
    }
6
7
    if( column_exists( 'reserves', 'expirationdate' ) ) {
8
        $dbh->do(q{ALTER TABLE reserves MODIFY column expirationdate datetime});
9
    }
10
11
    SetVersion( $DBversion );
12
    print "Upgrade to $DBversion done (Bug 24718 - Use datetime for reserves.reservedate and reserves.expirationdate)\n";
13
}
(-)a/installer/data/mysql/kohastructure.sql (-5 / +4 lines)
Lines 4882-4888 DROP TABLE IF EXISTS `old_reserves`; Link Here
4882
CREATE TABLE `old_reserves` (
4882
CREATE TABLE `old_reserves` (
4883
  `reserve_id` int(11) NOT NULL COMMENT 'primary key',
4883
  `reserve_id` int(11) NOT NULL COMMENT 'primary key',
4884
  `borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key from the borrowers table defining which patron this hold is for',
4884
  `borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key from the borrowers table defining which patron this hold is for',
4885
  `reservedate` date DEFAULT NULL COMMENT 'the date the hold was places',
4885
  `reservedate` datetime DEFAULT NULL COMMENT 'the date the hold was places',
4886
  `biblionumber` int(11) DEFAULT NULL COMMENT 'foreign key from the biblio table defining which bib record this hold is on',
4886
  `biblionumber` int(11) DEFAULT NULL COMMENT 'foreign key from the biblio table defining which bib record this hold is on',
4887
  `item_group_id` int(11) DEFAULT NULL COMMENT 'foreign key from the item_groups table defining if this is an item group level hold',
4887
  `item_group_id` int(11) DEFAULT NULL COMMENT 'foreign key from the item_groups table defining if this is an item group level hold',
4888
  `branchcode` varchar(10) DEFAULT NULL COMMENT 'foreign key from the branches table defining which branch the patron wishes to pick this hold up at',
4888
  `branchcode` varchar(10) DEFAULT NULL COMMENT 'foreign key from the branches table defining which branch the patron wishes to pick this hold up at',
Lines 4897-4903 CREATE TABLE `old_reserves` ( Link Here
4897
  `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'the date and time this hold was last updated',
4897
  `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'the date and time this hold was last updated',
4898
  `itemnumber` int(11) DEFAULT NULL COMMENT 'foreign key from the items table defining the specific item the patron has placed on hold or the item this hold was filled with',
4898
  `itemnumber` int(11) DEFAULT NULL COMMENT 'foreign key from the items table defining the specific item the patron has placed on hold or the item this hold was filled with',
4899
  `waitingdate` date DEFAULT NULL COMMENT 'the date the item was marked as waiting for the patron at the library',
4899
  `waitingdate` date DEFAULT NULL COMMENT 'the date the item was marked as waiting for the patron at the library',
4900
  `expirationdate` date DEFAULT NULL COMMENT 'the date the hold expires (usually the date entered by the patron to say they don''t need the hold after a certain date)',
4900
  `expirationdate` datetime DEFAULT NULL COMMENT 'the date the hold expires (usually the date entered by the patron to say they don''t need the hold after a certain date)',
4901
  `patron_expiration_date` date DEFAULT NULL COMMENT 'the date the hold expires - usually the date entered by the patron to say they don''t need the hold after a certain date',
4901
  `patron_expiration_date` date DEFAULT NULL COMMENT 'the date the hold expires - usually the date entered by the patron to say they don''t need the hold after a certain date',
4902
  `lowestPriority` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'has this hold been pinned to the lowest priority in the holds queue (1 for yes, 0 for no)',
4902
  `lowestPriority` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'has this hold been pinned to the lowest priority in the holds queue (1 for yes, 0 for no)',
4903
  `suspend` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'in this hold suspended (1 for yes, 0 for no)',
4903
  `suspend` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'in this hold suspended (1 for yes, 0 for no)',
Lines 5432-5438 DROP TABLE IF EXISTS `reserves`; Link Here
5432
CREATE TABLE `reserves` (
5432
CREATE TABLE `reserves` (
5433
  `reserve_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key',
5433
  `reserve_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key',
5434
  `borrowernumber` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the borrowers table defining which patron this hold is for',
5434
  `borrowernumber` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the borrowers table defining which patron this hold is for',
5435
  `reservedate` date DEFAULT NULL COMMENT 'the date the hold was placed',
5435
  `reservedate` datetime DEFAULT NULL COMMENT 'the date the hold was placed',
5436
  `biblionumber` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the biblio table defining which bib record this hold is on',
5436
  `biblionumber` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the biblio table defining which bib record this hold is on',
5437
  `item_group_id` int(11) DEFAULT NULL COMMENT 'foreign key from the item_groups table defining if this is an item group level hold',
5437
  `item_group_id` int(11) DEFAULT NULL COMMENT 'foreign key from the item_groups table defining if this is an item group level hold',
5438
  `branchcode` varchar(10) NOT NULL COMMENT 'foreign key from the branches table defining which branch the patron wishes to pick this hold up at',
5438
  `branchcode` varchar(10) NOT NULL COMMENT 'foreign key from the branches table defining which branch the patron wishes to pick this hold up at',
Lines 5447-5453 CREATE TABLE `reserves` ( Link Here
5447
  `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'the date and time this hold was last updated',
5447
  `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'the date and time this hold was last updated',
5448
  `itemnumber` int(11) DEFAULT NULL COMMENT 'foreign key from the items table defining the specific item the patron has placed on hold or the item this hold was filled with',
5448
  `itemnumber` int(11) DEFAULT NULL COMMENT 'foreign key from the items table defining the specific item the patron has placed on hold or the item this hold was filled with',
5449
  `waitingdate` date DEFAULT NULL COMMENT 'the date the item was marked as waiting for the patron at the library',
5449
  `waitingdate` date DEFAULT NULL COMMENT 'the date the item was marked as waiting for the patron at the library',
5450
  `expirationdate` date DEFAULT NULL COMMENT 'the date the hold expires (calculated value)',
5450
  `expirationdate` datetime DEFAULT NULL COMMENT 'the date the hold expires (calculated value)',
5451
  `patron_expiration_date` date DEFAULT NULL COMMENT 'the date the hold expires - usually the date entered by the patron to say they don''t need the hold after a certain date',
5451
  `patron_expiration_date` date DEFAULT NULL COMMENT 'the date the hold expires - usually the date entered by the patron to say they don''t need the hold after a certain date',
5452
  `lowestPriority` tinyint(1) NOT NULL DEFAULT 0,
5452
  `lowestPriority` tinyint(1) NOT NULL DEFAULT 0,
5453
  `suspend` tinyint(1) NOT NULL DEFAULT 0,
5453
  `suspend` tinyint(1) NOT NULL DEFAULT 0,
5454
- 

Return to bug 24718