mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-11-09 15:20:08 +00:00
13 lines
623 B
MySQL
13 lines
623 B
MySQL
|
CREATE TABLE chat1_session ( roomID INT(10) NOT NULL
|
||
|
, userID INT(10) NOT NULL
|
||
|
, sessionID BINARY(16) NOT NULL
|
||
|
, lastRequest INT(10) NOT NULL
|
||
|
|
||
|
, PRIMARY KEY (roomID, userID, sessionID)
|
||
|
, KEY (userID, sessionID)
|
||
|
, KEY (sessionID)
|
||
|
);
|
||
|
|
||
|
ALTER TABLE chat1_session ADD FOREIGN KEY (roomID) REFERENCES chat1_room (roomID) ON DELETE CASCADE;
|
||
|
ALTER TABLE chat1_session ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE CASCADE;
|