summaryrefslogtreecommitdiff
path: root/setup.sql
diff options
context:
space:
mode:
authorcflip <36554078+cflip@users.noreply.github.com>2021-06-23 15:18:25 -0600
committercflip <36554078+cflip@users.noreply.github.com>2021-06-23 15:18:25 -0600
commit4b01ac4021c26c05141f0fbeae20a1c50adbaabf (patch)
tree090d48b791df51cb69dd06426b6f473ed834f8a5 /setup.sql
parent9a31845c98eca3896b50bfd4425d937d5a1e9b08 (diff)
Move some files into separate directory
Diffstat (limited to 'setup.sql')
-rw-r--r--setup.sql44
1 files changed, 0 insertions, 44 deletions
diff --git a/setup.sql b/setup.sql
deleted file mode 100644
index 6a96b8a..0000000
--- a/setup.sql
+++ /dev/null
@@ -1,44 +0,0 @@
-CREATE TABLE users (
- user_id INT(8) NOT NULL AUTO_INCREMENT,
- user_name VARCHAR(30) NOT NULL,
- user_pass VARCHAR(255) NOT NULL,
- user_level INT(8) NOT NULL DEFAULT 0,
- user_date DATETIME NOT NULL,
- UNIQUE INDEX user_name_unique (user_name),
- PRIMARY KEY (user_id)
-) ENGINE = InnoDB;
-
-CREATE TABLE categories (
- cat_id INT(8) NOT NULL AUTO_INCREMENT,
- cat_name VARCHAR(255) NOT NULL,
- cat_description VARCHAR(255) NOT NULL,
- cat_thread_count INT(8) NOT NULL DEFAULT 0,
- cat_post_count INT(8) NOT NULL DEFAULT 0,
- UNIQUE INDEX cat_name_unique (cat_name),
- PRIMARY KEY (cat_id)
-) ENGINE = InnoDB;
-
-CREATE TABLE threads (
- thread_id INT(8) NOT NULL AUTO_INCREMENT,
- thread_subject VARCHAR(255) NOT NULL,
- thread_date_created DATETIME NOT NULL,
- thread_date_lastpost DATETIME NOT NULL,
- thread_category 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_created DATETIME NOT NULL,
- post_date_edited DATETIME,
- post_thread INT(8) NOT NULL,
- post_author INT(8) NOT NULL,
- PRIMARY KEY (post_id)
-) ENGINE = InnoDB;
-
-ALTER TABLE threads ADD FOREIGN KEY(thread_category) 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;