Lines 2843-2852
CREATE TABLE IF NOT EXISTS `social_data` (
Link Here
|
2843 |
-- |
2843 |
-- |
2844 |
|
2844 |
|
2845 |
DROP TABLE IF EXISTS ratings; |
2845 |
DROP TABLE IF EXISTS ratings; |
2846 |
CREATE TABLE ratings ( |
2846 |
CREATE TABLE ratings ( -- information related to the star ratings in the OPAC |
2847 |
borrowernumber int(11) NOT NULL, -- the borrower this rating is for |
2847 |
borrowernumber int(11) NOT NULL, -- the borrowernumber of the patron who left this rating (borrowers.borrowernumber) |
2848 |
biblionumber int(11) NOT NULL, -- the biblio it's for |
2848 |
biblionumber int(11) NOT NULL, -- the biblio this rating is for (biblio.biblionumber) |
2849 |
rating_value tinyint(1) NOT NULL, -- the rating, from 1-5 |
2849 |
rating_value tinyint(1) NOT NULL, -- the rating, from 1 to 5 |
2850 |
timestamp timestamp NOT NULL default CURRENT_TIMESTAMP, |
2850 |
timestamp timestamp NOT NULL default CURRENT_TIMESTAMP, |
2851 |
PRIMARY KEY (borrowernumber,biblionumber), |
2851 |
PRIMARY KEY (borrowernumber,biblionumber), |
2852 |
CONSTRAINT ratings_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE, |
2852 |
CONSTRAINT ratings_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE, |
2853 |
- |
|
|