Line 0
Link Here
|
0 |
- |
1 |
CREATE TABLE `koha_kohaqa`.`article_requests` ( |
|
|
2 |
`id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , |
3 |
`borrowernumber` INT( 11 ) NOT NULL, |
4 |
`biblionumber` INT( 11 ) NOT NULL , |
5 |
`itemnumber` INT NULL , |
6 |
`title` TEXT NULL DEFAULT NULL , |
7 |
`author` TEXT NULL DEFAULT NULL , |
8 |
`volume` TEXT NULL DEFAULT NULL , |
9 |
`issue` TEXT NULL DEFAULT NULL , |
10 |
`date` TEXT NULL DEFAULT NULL , |
11 |
`pages` TEXT NULL DEFAULT NULL , |
12 |
`chapters` TEXT NULL DEFAULT NULL , |
13 |
`created_on` TIMESTAMP NOT NULL , |
14 |
`updated_on` TIMESTAMP NULL DEFAULT NULL , |
15 |
INDEX ( `borrowernumber` ), |
16 |
INDEX ( `biblionumber` ), |
17 |
INDEX ( `itemnumber` ) |
18 |
) ENGINE = INNODB; |
19 |
|
20 |
ALTER TABLE `article_requests` ADD FOREIGN KEY ( `borrowernumber` ) REFERENCES `koha_kohaqa`.`borrowers` ( |
21 |
`borrowernumber` |
22 |
) ON DELETE CASCADE ON UPDATE CASCADE ; |
23 |
|
24 |
ALTER TABLE `article_requests` ADD FOREIGN KEY ( `biblionumber` ) REFERENCES `koha_kohaqa`.`biblio` ( |
25 |
`biblionumber` |
26 |
) ON DELETE CASCADE ON UPDATE CASCADE ; |
27 |
|
28 |
ALTER TABLE `article_requests` ADD FOREIGN KEY ( `itemnumber` ) REFERENCES `koha_kohaqa`.`items` ( |
29 |
`itemnumber` |
30 |
) ON DELETE SET NULL ON UPDATE CASCADE ; |