Skip to content

Commit

Permalink
Merge pull request #37 from IvonneBenitesRodriguez/schema-correct
Browse files Browse the repository at this point in the history
add-Game-and-Author-Schema-PullRequest
  • Loading branch information
gilberthappi authored Nov 30, 2023
2 parents 1683167 + 8b1560d commit 416ea3c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion data/game.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[{"publish_date":"2023-01-02","multiplayer":true,"last_played_at":"2023-10-10"},
{"publish_date":"2023-11-11","multiplayer":true,"last_played_at":"2023-11-02"}]
{"publish_date":"2005-04-23","multiplayer":true,"last_played_at":"2007-05-06"}]
18 changes: 18 additions & 0 deletions database/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,21 @@ CREATE TABLE book(
item_id INTEGER,
FOREIGN KEY(item_id) REFERENCES items(id)
);


CREATE TABLE author(
id SERIAL PRIMARY KEY,
first_name VARCHAR(100),
last_name VARCHAR(100),
);

CREATE TABLE game(
id INTEGER PRIMARY KEY,
multiplayer BOOLEAN,
last_played_at DATE,
item_id INTEGER,
FOREIGN KEY(item_id) REFERENCES items(id)
);

CREATE INDEX idx_book_item_id ON book(item_id);
CREATE INDEX idx_item_label_id ON item(label_id);

0 comments on commit 416ea3c

Please sign in to comment.