1 CREATE TABLE watch_group (
2 uid
int(11) unsigned
NOT NULL DEFAULT '0',
3 groupid
smallint(5) unsigned
NOT NULL DEFAULT '0',
4 PRIMARY KEY (uid
, groupid
),
5 CONSTRAINT FOREIGN KEY (uid
) REFERENCES accounts (uid
) ON DELETE CASCADE ON UPDATE CASCADE,
6 CONSTRAINT FOREIGN KEY (groupid
) REFERENCES groups (id) ON DELETE CASCADE ON UPDATE CASCADE
7 ) ENGINE
=InnoDB
DEFAULT CHARSET
=utf8
;
9 -- vim:set syntax=mysql: