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 3861-3867 DROP TABLE IF EXISTS `old_reserves`; Link Here
3861
CREATE TABLE `old_reserves` (
3861
CREATE TABLE `old_reserves` (
3862
  `reserve_id` int(11) NOT NULL COMMENT 'primary key',
3862
  `reserve_id` int(11) NOT NULL COMMENT 'primary key',
3863
  `borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key from the borrowers table defining which patron this hold is for',
3863
  `borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key from the borrowers table defining which patron this hold is for',
3864
  `reservedate` date DEFAULT NULL COMMENT 'the date the hold was places',
3864
  `reservedate` datetime DEFAULT NULL COMMENT 'the date the hold was places',
3865
  `biblionumber` int(11) DEFAULT NULL COMMENT 'foreign key from the biblio table defining which bib record this hold is on',
3865
  `biblionumber` int(11) DEFAULT NULL COMMENT 'foreign key from the biblio table defining which bib record this hold is on',
3866
  `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key from the branches table defining which branch the patron wishes to pick this hold up at',
3866
  `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key from the branches table defining which branch the patron wishes to pick this hold up at',
3867
  `desk_id` int(11) DEFAULT NULL COMMENT 'foreign key from the desks table defining which desk the patron should pick this hold up at',
3867
  `desk_id` int(11) DEFAULT NULL COMMENT 'foreign key from the desks table defining which desk the patron should pick this hold up at',
Lines 3875-3881 CREATE TABLE `old_reserves` ( Link Here
3875
  `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'the date and time this hold was last updated',
3875
  `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'the date and time this hold was last updated',
3876
  `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',
3876
  `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',
3877
  `waitingdate` date DEFAULT NULL COMMENT 'the date the item was marked as waiting for the patron at the library',
3877
  `waitingdate` date DEFAULT NULL COMMENT 'the date the item was marked as waiting for the patron at the library',
3878
  `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)',
3878
  `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)',
3879
  `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)',
3879
  `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)',
3880
  `suspend` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'in this hold suspended (1 for yes, 0 for no)',
3880
  `suspend` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'in this hold suspended (1 for yes, 0 for no)',
3881
  `suspend_until` datetime DEFAULT NULL COMMENT 'the date this hold is suspended until (NULL for infinitely)',
3881
  `suspend_until` datetime DEFAULT NULL COMMENT 'the date this hold is suspended until (NULL for infinitely)',
Lines 4304-4310 DROP TABLE IF EXISTS `reserves`; Link Here
4304
CREATE TABLE `reserves` (
4304
CREATE TABLE `reserves` (
4305
  `reserve_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key',
4305
  `reserve_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key',
4306
  `borrowernumber` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the borrowers table defining which patron this hold is for',
4306
  `borrowernumber` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the borrowers table defining which patron this hold is for',
4307
  `reservedate` date DEFAULT NULL COMMENT 'the date the hold was placed',
4307
  `reservedate` datetime DEFAULT NULL COMMENT 'the date the hold was placed',
4308
  `biblionumber` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the biblio table defining which bib record this hold is on',
4308
  `biblionumber` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the biblio table defining which bib record this hold is on',
4309
  `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key from the branches table defining which branch the patron wishes to pick this hold up at',
4309
  `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key from the branches table defining which branch the patron wishes to pick this hold up at',
4310
  `desk_id` int(11) DEFAULT NULL COMMENT 'foreign key from the desks table defining which desk the patron should pick this hold up at',
4310
  `desk_id` int(11) DEFAULT NULL COMMENT 'foreign key from the desks table defining which desk the patron should pick this hold up at',
Lines 4318-4324 CREATE TABLE `reserves` ( Link Here
4318
  `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'the date and time this hold was last updated',
4318
  `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'the date and time this hold was last updated',
4319
  `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',
4319
  `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',
4320
  `waitingdate` date DEFAULT NULL COMMENT 'the date the item was marked as waiting for the patron at the library',
4320
  `waitingdate` date DEFAULT NULL COMMENT 'the date the item was marked as waiting for the patron at the library',
4321
  `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)',
4321
  `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)',
4322
  `lowestPriority` tinyint(1) NOT NULL DEFAULT 0,
4322
  `lowestPriority` tinyint(1) NOT NULL DEFAULT 0,
4323
  `suspend` tinyint(1) NOT NULL DEFAULT 0,
4323
  `suspend` tinyint(1) NOT NULL DEFAULT 0,
4324
  `suspend_until` datetime DEFAULT NULL,
4324
  `suspend_until` datetime DEFAULT NULL,
4325
- 

Return to bug 24718