From 35a22767fca6dc19eb50e3e691df538d6a8883c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 27 Nov 2011 12:34:02 +0100 Subject: [PATCH] Updating database structure --- install.sql | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/install.sql b/install.sql index f13d368..96bc86a 100644 --- a/install.sql +++ b/install.sql @@ -3,15 +3,15 @@ CREATE TABLE wcf1_chat_message ( messageID int(10) NOT NULL AUTO_INCREMENT, roomID int(10) NOT NULL, sender int(10) DEFAULT NULL, - username varchar(255) NOT NULL, - receiver int(10) NOT NULL, - "time" int(10) NOT NULL, - "type" tinyint(3) NOT NULL, + username varchar(255) DEFAULT NULL, + receiver int(10) DEFAULT NULL, + time int(10) NOT NULL, + type tinyint(3) NOT NULL DEFAULT 1, message mediumtext NOT NULL, - enableSmilies tinyint(1) NOT NULL, - enableHTML tinyint(1) NOT NULL, - color1 int(10) NOT NULL, - color2 int(10) NOT NULL, + enableSmilies tinyint(1) NOT NULL DEFAULT 1, + enableHTML tinyint(1) NOT NULL DEFAULT 0, + color1 int(10) NOT NULL DEFAULT 0, + color2 int(10) NOT NULL DEFAULT 0, PRIMARY KEY (messageID), KEY roomID (roomID), KEY sender (sender), @@ -25,15 +25,15 @@ CREATE TABLE wcf1_chat_room ( topic varchar(255) NOT NULL, position int(10) NOT NULL DEFAULT '0', permanent tinyint(1) NOT NULL DEFAULT '1', - "owner" int(10) DEFAULT NULL, + owner int(10) DEFAULT NULL, PRIMARY KEY (roomID), KEY position (position), - KEY "owner" ("owner") + KEY owner (owner) ); ALTER TABLE wcf1_chat_message ADD FOREIGN KEY (receiver) REFERENCES wcf1_user (userID) ON DELETE CASCADE; -ALTER TABLE wcf1_chat_message ADD FOREIGN KEY (roomID) REFERENCES wcf1_chat_room (roomID) ON DELETE CASCADE, +ALTER TABLE wcf1_chat_message ADD FOREIGN KEY (roomID) REFERENCES wcf1_chat_room (roomID) ON DELETE CASCADE; ALTER TABLE wcf1_chat_message ADD FOREIGN KEY (sender) REFERENCES wcf1_user (userID) ON DELETE SET NULL; -ALTER TABLE wcf1_chat_room ADD FOREIGN KEY ("owner") REFERENCES wcf1_user (userID) ON DELETE SET NULL; \ No newline at end of file +ALTER TABLE wcf1_chat_room ADD FOREIGN KEY (owner) REFERENCES wcf1_user (userID) ON DELETE SET NULL; \ No newline at end of file