-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dbfixtures): add support for sqlite3
Add support for sqlite3 to dbfixtures executor (#613) Signed-off-by: Elias Tandel <elias.tandel@90poe.io>
- Loading branch information
Showing
5 changed files
with
100 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
DROP TABLE IF EXISTS comments; | ||
DROP TABLE IF EXISTS posts_tags; | ||
DROP TABLE IF EXISTS posts; | ||
DROP TABLE IF EXISTS tags; | ||
DROP TABLE IF EXISTS users; | ||
|
||
CREATE TABLE posts ( | ||
id SERIAL PRIMARY KEY | ||
,title VARCHAR NOT NULL | ||
,content TEXT NOT NULL | ||
,created_at TIMESTAMP NOT NULL | ||
,updated_at TIMESTAMP NOT NULL | ||
); | ||
|
||
CREATE TABLE tags ( | ||
id SERIAL PRIMARY KEY | ||
,name VARCHAR NOT NULL | ||
,created_at TIMESTAMP NOT NULL | ||
,updated_at TIMESTAMP NOT NULL | ||
); | ||
|
||
CREATE TABLE posts_tags ( | ||
post_id INTEGER NOT NULL | ||
,tag_id INTEGER NOT NULL | ||
,PRIMARY KEY (post_id, tag_id) | ||
,FOREIGN KEY (post_id) REFERENCES posts (id) | ||
,FOREIGN KEY (tag_id) REFERENCES tags (id) | ||
); | ||
|
||
CREATE TABLE comments ( | ||
id SERIAL PRIMARY KEY NOT NULL | ||
,post_id INTEGER NOT NULL | ||
,author_name VARCHAR NOT NULL | ||
,author_email VARCHAR NOT NULL | ||
,content TEXT NOT NULL | ||
,created_at TIMESTAMP NOT NULL | ||
,updated_at TIMESTAMP NOT NULL | ||
,FOREIGN KEY (post_id) REFERENCES posts (id) | ||
); | ||
|
||
CREATE TABLE users ( | ||
id SERIAL PRIMARY KEY NOT NULL | ||
,attributes VARCHAR NOT NULL | ||
); | ||
|