Fixed formatting errors in create_db.sql
This commit is contained in:
parent
714cdd9aaf
commit
10d8fceb77
@ -11,13 +11,13 @@ CREATE TABLE users (
|
||||
first_name VARCHAR(50) NOT NULL,
|
||||
last_name VARCHAR(50) NOT NULL,
|
||||
role INT NOT NULL,
|
||||
PRIMARY KEY(id)
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE issues (
|
||||
id INT AUTO_INCREMENT,
|
||||
published BOOL NOT NULL,
|
||||
PRIMARY KEY(id)
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE articles (
|
||||
@ -30,21 +30,21 @@ CREATE TABLE articles (
|
||||
rejected BOOL NOT NULL,
|
||||
author_id INT NOT NULL,
|
||||
issue_id INT NOT NULL,
|
||||
PRIMARY KEY(id),
|
||||
FOREIGN KEY(author_id) REFERENCES users(id),
|
||||
FOREIGN KEY(issue_id) REFERENCES issues(id)
|
||||
PRIMARY KEY (id),
|
||||
FOREIGN KEY (author_id) REFERENCES users (id),
|
||||
FOREIGN KEY (issue_id) REFERENCES issues (id)
|
||||
);
|
||||
|
||||
CREATE TABLE tags (
|
||||
id INT AUTO_INCREMENT,
|
||||
name VARCHAR(50) NOT NULL UNIQUE,
|
||||
PRIMARY KEY(id)
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE articles_tags (
|
||||
article_id INT,
|
||||
tag_id INT,
|
||||
PRIMARY KEY(article_id, tag_id),
|
||||
FOREIGN KEY(article_id) REFERENCES articles(id),
|
||||
FOREIGN KEY(tag_id) REFERENCES tags(id)
|
||||
PRIMARY KEY (article_id, tag_id),
|
||||
FOREIGN KEY (article_id) REFERENCES articles (id),
|
||||
FOREIGN KEY (tag_id) REFERENCES tags (id)
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user