· 8 years ago · Jul 19, 2018, 11:40 AM
1SET NAMES utf8;
2SET FOREIGN_KEY_CHECKS = 0;
3
4DROP TABLE IF EXISTS `sithand`;
5
6CREATE TABLE `sithand` (
7 `sithandid` int(6) unsigned NOT NULL auto_increment,
8 `userid` tinyint(2) unsigned NOT NULL,
9 `sitid` int(6) unsigned NOT NULL,
10 `handid` int(6) unsigned NOT NULL,
11 PRIMARY KEY (`sithandid`),
12 KEY `userid` (`userid`),
13 KEY `sitid` (`sitid`),
14 KEY `handid` (`handid`),
15 CONSTRAINT `sithand_handid` FOREIGN KEY (`handid`) REFERENCES `hands` (`handid`) ON DELETE CASCADE ON UPDATE CASCADE,
16 CONSTRAINT `sithand_sitid` FOREIGN KEY (`sitid`) REFERENCES `situations` (`sitid`) ON DELETE CASCADE ON UPDATE CASCADE,
17 CONSTRAINT `sithand_userid` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON DELETE CASCADE ON UPDATE CASCADE
18) ENGINE=InnoDB DEFAULT CHARSET=utf8;
19
20SET FOREIGN_KEY_CHECKS = 1;