summaryrefslogtreecommitdiff
path: root/setup.sql
diff options
context:
space:
mode:
Diffstat (limited to 'setup.sql')
-rw-r--r--setup.sql22
1 files changed, 11 insertions, 11 deletions
diff --git a/setup.sql b/setup.sql
index 642c46a..f51250b 100644
--- a/setup.sql
+++ b/setup.sql
@@ -15,25 +15,25 @@ CREATE TABLE categories (
PRIMARY KEY (cat_id)
) ENGINE = InnoDB;
-CREATE TABLE topics (
- topic_id INT(8) NOT NULL AUTO_INCREMENT,
- topic_subject VARCHAR(255) NOT NULL,
- topic_date DATETIME NOT NULL,
- topic_cat INT(8) NOT NULL,
- topic_author INT(8) NOT NULL,
- PRIMARY KEY (topic_id)
+CREATE TABLE threads (
+ thread_id INT(8) NOT NULL AUTO_INCREMENT,
+ thread_subject VARCHAR(255) NOT NULL,
+ thread_date DATETIME NOT NULL,
+ thread_cat INT(8) NOT NULL,
+ thread_author INT(8) NOT NULL,
+ PRIMARY KEY (thread_id)
) ENGINE = InnoDB;
CREATE TABLE posts (
post_id INT(8) NOT NULL AUTO_INCREMENT,
post_content TEXT NOT NULL,
post_date DATETIME NOT NULL,
- post_topic INT(8) NOT NULL,
+ post_thread INT(8) NOT NULL,
post_author INT(8) NOT NULL,
PRIMARY KEY (post_id)
) ENGINE = InnoDB;
-ALTER TABLE topics ADD FOREIGN KEY(topic_cat) REFERENCES categories(cat_id) ON DELETE CASCADE ON UPDATE CASCADE;
-ALTER TABLE topics ADD FOREIGN KEY(topic_author) REFERENCES users(user_id) ON DELETE RESTRICT ON UPDATE CASCADE;
-ALTER TABLE posts ADD FOREIGN KEY(post_topic) REFERENCES topics(topic_id) ON DELETE CASCADE ON UPDATE CASCADE;
+ALTER TABLE threads ADD FOREIGN KEY(thread_cat) REFERENCES categories(cat_id) ON DELETE CASCADE ON UPDATE CASCADE;
+ALTER TABLE threads ADD FOREIGN KEY(thread_author) REFERENCES users(user_id) ON DELETE RESTRICT ON UPDATE CASCADE;
+ALTER TABLE posts ADD FOREIGN KEY(post_thread) REFERENCES threads(thread_id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE posts ADD FOREIGN KEY(post_author) REFERENCES users(user_id) ON DELETE RESTRICT ON UPDATE CASCADE;