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

(-)a/installer/data/mysql/atomicupdate/bug18591-ill-comments.perl (+26 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    unless (TableExists('illcomments')) {
4
        $dbh->do(q{
5
            CREATE TABLE illcomments (
6
                illcomment_id int(11) NOT NULL AUTO_INCREMENT, -- Unique ID of the comment
7
                illrequest_id bigint(20) unsigned NOT NULL,    -- ILL request number
8
                borrowernumber integer DEFAULT NULL,           -- Link to the user who made the comment (could be librarian, patron or ILL partner library)
9
                comment text DEFAULT NULL,                     -- The text of the comment
10
                timestamp timestamp DEFAULT CURRENT_TIMESTAMP, -- Date and time when the comment was made
11
                PRIMARY KEY  ( illcomment_id ),
12
                CONSTRAINT illcomments_bnfk
13
                  FOREIGN KEY ( borrowernumber )
14
                  REFERENCES  borrowers  ( borrowernumber )
15
                  ON UPDATE CASCADE ON DELETE CASCADE,
16
                CONSTRAINT illcomments_ifk
17
                  FOREIGN KEY (illrequest_id)
18
                  REFERENCES illrequests ( illrequest_id )
19
                  ON UPDATE CASCADE ON DELETE CASCADE
20
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
21
        });
22
    }
23
24
    SetVersion( $DBversion );
25
    print "Upgrade to $DBversion done (Bug 18591 - Add comments to ILL requests)\n";
26
}
(-)a/installer/data/mysql/kohastructure.sql (-1 / +20 lines)
Lines 4208-4213 CREATE TABLE `oauth_access_tokens` ( Link Here
4208
    `client_id`    VARCHAR(191) NOT NULL, -- the client id the access token belongs to
4208
    `client_id`    VARCHAR(191) NOT NULL, -- the client id the access token belongs to
4209
    `expires`      INT NOT NULL,          -- expiration time in seconds
4209
    `expires`      INT NOT NULL,          -- expiration time in seconds
4210
    PRIMARY KEY (`access_token`)
4210
    PRIMARY KEY (`access_token`)
4211
4212
-- Table structure for table illcomments
4213
--
4214
4215
DROP TABLE IF EXISTS illcomments;
4216
CREATE TABLE illcomments (
4217
    illcomment_id int(11) NOT NULL AUTO_INCREMENT, -- Unique ID of the comment
4218
    illrequest_id bigint(20) unsigned NOT NULL,    -- ILL request number
4219
    borrowernumber integer DEFAULT NULL,           -- Link to the user who made the comment (could be librarian, patron or ILL partner library)
4220
    comment text DEFAULT NULL,                     -- The text of the comment
4221
    timestamp timestamp DEFAULT CURRENT_TIMESTAMP, -- Date and time when the comment was made
4222
    PRIMARY KEY  ( illcomment_id ),
4223
    CONSTRAINT illcomments_bnfk
4224
      FOREIGN KEY ( borrowernumber )
4225
      REFERENCES  borrowers  ( borrowernumber )
4226
      ON UPDATE CASCADE ON DELETE CASCADE,
4227
    CONSTRAINT illcomments_ifk
4228
      FOREIGN KEY (illrequest_id)
4229
      REFERENCES illrequests ( illrequest_id )
4230
      ON UPDATE CASCADE ON DELETE CASCADE
4211
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4231
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4212
4232
4213
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4233
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4214
- 

Return to bug 18591