· 8 years ago · Jul 10, 2018, 05:58 PM
1DROP TABLE IF EXISTS `collections_votes`;
2CREATE TABLE `collections_votes` (
3 `collection_id` int(11) unsigned NOT NULL default '0',
4 `user_id` int(11) unsigned NOT NULL default '0',
5 `vote` tinyint(2) NOT NULL default '0',
6 `created` datetime NOT NULL default '0000-00-00 00:00:00',
7 PRIMARY KEY (`collection_id`,`user_id`),
8 KEY `user_id` (`user_id`),
9 CONSTRAINT `collections_votes_ibfk_1` FOREIGN KEY (`collection_id`) REFERENCES `collections` (`id`),
10 CONSTRAINT `collections_votes_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
11) ENGINE=InnoDB DEFAULT CHARSET=utf8;