Skip to content

Commit

Permalink
Remove dublicated items table
Browse files Browse the repository at this point in the history
  • Loading branch information
Benawi committed Aug 25, 2023
1 parent 04031d0 commit 0111d23
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 35 deletions.
2 changes: 1 addition & 1 deletion lib/helpers/json/authors.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["{\"first_name\":\"derick\",\"last_name\":\"bena\",\"items\":[\"{\\\"id\\\":838,\\\"title\\\":\\\"chess\\\",\\\"multiplayer\\\":true,\\\"last_played_at\\\":\\\"2\\\",\\\"archived\\\":false,\\\"published_date\\\":\\\"2023-08-24\\\"}\"]}"]
["{\"first_name\":\"derick\",\"last_name\":\"bena\",\"items\":[\"{\\\"id\\\":853,\\\"title\\\":\\\"chess\\\",\\\"multiplayer\\\":true,\\\"last_played_at\\\":\\\"2\\\",\\\"archived\\\":false,\\\"published_date\\\":\\\"2023-08-24\\\"}\"]}"]
2 changes: 1 addition & 1 deletion lib/helpers/json/books.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["{\"id\":362,\"archived\":false,\"published_date\":\"2023-08-24\",\"publisher\":\"Bena\",\"cover_state\":\"sta\"}","{\"id\":870,\"archived\":false,\"published_date\":\"2023-08-24\",\"publisher\":\"Benawi\",\"cover_state\":\"stat\"}","{\"id\":288,\"archived\":false,\"published_date\":\"2023-08-08\",\"publisher\":\"Ruby prog\",\"cover_state\":\"true\"}"]
["{\"id\":87,\"archived\":false,\"published_date\":\"2023-08-24\",\"publisher\":\"Bena\",\"cover_state\":\"sta\"}","{\"id\":806,\"archived\":false,\"published_date\":\"2023-08-24\",\"publisher\":\"Benawi\",\"cover_state\":\"stat\"}","{\"id\":878,\"archived\":false,\"published_date\":\"2023-08-08\",\"publisher\":\"Ruby prog\",\"cover_state\":\"true\"}"]
2 changes: 1 addition & 1 deletion lib/helpers/json/games.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["{\"id\":838,\"title\":\"chess\",\"multiplayer\":true,\"last_played_at\":\"2\",\"archived\":false,\"published_date\":\"2023-08-24\"}"]
["{\"id\":853,\"title\":\"chess\",\"multiplayer\":true,\"last_played_at\":\"2\",\"archived\":false,\"published_date\":\"2023-08-24\"}"]
2 changes: 1 addition & 1 deletion lib/helpers/json/labels.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["{\"title\":\"edu\",\"color\":\"red\",\"items\":[\"{\\\"id\\\":870,\\\"archived\\\":false,\\\"published_date\\\":\\\"2023-08-24\\\",\\\"publisher\\\":\\\"Benawi\\\",\\\"cover_state\\\":\\\"stat\\\"}\"]}"]
["{\"title\":\"edu\",\"color\":\"red\",\"items\":[\"{\\\"id\\\":806,\\\"archived\\\":false,\\\"published_date\\\":\\\"2023-08-24\\\",\\\"publisher\\\":\\\"Benawi\\\",\\\"cover_state\\\":\\\"stat\\\"}\"]}"]
31 changes: 0 additions & 31 deletions sql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,6 @@ CREATE TABLE genres (
PRIMARY KEY(id)
);

CREATE TABLE items (
id int GENERATED ALWAYS AS IDENTITY(MINVALUE 0 START WITH 0 CACHE 20) NOT NULL,
PRIMARY KEY (id),
genre varchar(30),
author varchar(30),
source varchar(30),
label varchar(30),
publish_date int,
archived boolean,
author_id int,
game_id int,
album_id int,
genre_id int,
CONSTRAINT kf_albums FOREIGN KEY(album_id) REFERENCES albums(id) ON DELETE CASCADE,
CONSTRAINT kf_genres FOREIGN KEY(genre_id) REFERENCES genres(id) ON DELETE CASCADE
);
CREATE TABLE games (
id int GENERATED ALWAYS AS IDENTITY(MINVALUE 0 START WITH 0 CACHE 20) NOT NULL,
PRIMARY KEY (id),
Expand All @@ -75,19 +59,4 @@ CREATE TABLE authors (
PRIMARY KEY (id),
first_name varchar(30),
last_name varchar(30)
);

CREATE TABLE items (
id int GENERATED ALWAYS AS IDENTITY(MINVALUE 0 START WITH 0 CACHE 20) NOT NULL,
PRIMARY KEY (id),
genre varchar(30),
author varchar(30),
source varchar(30),
label varchar(30),
publish_date date,
archived boolean,
author_id int,
game_id int,
CONSTRAINT kf_authors FOREIGN KEY(author_id) REFERENCES authors(id) ON DELETE CASCADE,
CONSTRAINT kf_games FOREIGN KEY(game_id) REFERENCES games(id) ON DELETE CASCADE
);

0 comments on commit 0111d23

Please sign in to comment.