From 279d399461e6a66157bb2f0bc8209bf0fcb36c9c Mon Sep 17 00:00:00 2001
From: Cflip <36554078+cflip@users.noreply.github.com>
Date: Sat, 23 Jan 2021 12:25:51 -0700
Subject: Change terminology from topics to threads

---
 setup.sql | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

(limited to 'setup.sql')

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;
-- 
cgit v1.2.3

