summaryrefslogtreecommitdiff
path: root/setup.sql
diff options
context:
space:
mode:
authorCflip <36554078+cflip@users.noreply.github.com>2021-01-23 00:41:52 -0700
committerCflip <36554078+cflip@users.noreply.github.com>2021-01-23 00:41:52 -0700
commite32f683d2d339b33341a072b4674c4def90a51e5 (patch)
tree271694679cf554bc18acbc8540be93773c96c7c9 /setup.sql
parentd167fc370956bafa0a22ed437500e7db07ac9a10 (diff)
Fix indentation in setup.sql
Diffstat (limited to 'setup.sql')
-rw-r--r--setup.sql37
1 files changed, 18 insertions, 19 deletions
diff --git a/setup.sql b/setup.sql
index b43ebf2..642c46a 100644
--- a/setup.sql
+++ b/setup.sql
@@ -1,40 +1,39 @@
CREATE TABLE users (
- user_id INT(8) NOT NULL AUTO_INCREMENT,
- user_name VARCHAR(30) NOT NULL,
- user_pass VARCHAR(255) NOT NULL,
- user_date DATETIME NOT NULL,
+ user_id INT(8) NOT NULL AUTO_INCREMENT,
+ user_name VARCHAR(30) NOT NULL,
+ user_pass VARCHAR(255) NOT NULL,
+ 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_id INT(8) NOT NULL AUTO_INCREMENT,
+ cat_name VARCHAR(255) NOT NULL,
+ cat_description VARCHAR(255) NOT NULL,
UNIQUE INDEX cat_name_unique (cat_name),
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,
+ 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)
) 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_author INT(8) NOT NULL,
-PRIMARY KEY (post_id)
+ 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_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 posts ADD FOREIGN KEY(post_author) REFERENCES users(user_id) ON DELETE RESTRICT ON UPDATE CASCADE;
-