diff --git a/create_db.sql b/create_db.sql index 1a0f873..1fa3d1a 100644 --- a/create_db.sql +++ b/create_db.sql @@ -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) );