diff options
author | Cflip <36554078+cflip@users.noreply.github.com> | 2021-01-23 00:41:52 -0700 |
---|---|---|
committer | Cflip <36554078+cflip@users.noreply.github.com> | 2021-01-23 00:41:52 -0700 |
commit | e32f683d2d339b33341a072b4674c4def90a51e5 (patch) | |
tree | 271694679cf554bc18acbc8540be93773c96c7c9 /setup.sql | |
parent | d167fc370956bafa0a22ed437500e7db07ac9a10 (diff) |
Fix indentation in setup.sql
Diffstat (limited to 'setup.sql')
-rw-r--r-- | setup.sql | 37 |
1 files changed, 18 insertions, 19 deletions
@@ -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; - |