Created
February 8, 2012 05:50
-
-
Save cyberstream/1765879 to your computer and use it in GitHub Desktop.
The SQL code for creating the ratings table for the "Fix the Web" server-side project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS `ratings` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`id_foreign_key` int(11) NOT NULL COMMENT 'links this row to the report or comment in the reports table', | |
`username` varchar(128) NOT NULL, | |
`is_read` tinyint(1) NOT NULL COMMENT '0 => not read, 1 => is read', | |
`rating` tinyint(1) NOT NULL COMMENT '-1 => rate comment down; 0 => this is a subscription, not a rating; 1 => rate comment up', | |
PRIMARY KEY (`id`), | |
KEY `id_foreign_key` (`id_foreign_key`,`is_read`), | |
KEY `rating` (`rating`) | |
) ENGINE=InnoDB; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment