Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 436407b

Browse files
updated schema
1 parent 131ca8f commit 436407b

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

‎src/main/resources/data.sql

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,15 @@ INSERT INTO "user" (id_user, username, email, password, picture) VALUES
3737

3838
INSERT INTO "user" (id_user, username, email, password, picture) VALUES
3939
(3, 'adamsmith', 'adamsmith@adamsmith.it', 'adamsmithadamsmith', 'https://images.unsplash.com/photo-1508138221679-760a23a2285b');
40+
41+
INSERT INTO reading (id_reading, id_user, id_book, date, state) VALUES
42+
(1, 1, 2, '2021年08月20日', 'COMPLETED');
43+
44+
INSERT INTO reading (id_reading, id_user, id_book, date, state) VALUES
45+
(2, 1, 2, '2021年07月20日', 'COMPLETED');
46+
47+
INSERT INTO reading (id_reading, id_user, id_book, date, state) VALUES
48+
(3, 2, 4, '2021年09月20日', 'COMPLETED');
49+
50+
INSERT INTO reading (id_reading, id_user, id_book, date, state) VALUES
51+
(4, 2, 5, '2021年09月29日', 'COMPLETED');

‎src/main/resources/schema.sql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,14 @@ CREATE TABLE user(
2121
password VARCHAR(100) NOT NULL,
2222
isbn VARCHAR(20),
2323
picture VARCHAR(100)
24+
);
25+
26+
CREATE TABLE reading (
27+
id_reading SERIAL PRIMARY KEY,
28+
id_user INT NOT NULL,
29+
id_book INT NOT NULL,
30+
date DATE NOT NULL,
31+
state VARCHAR(100) NOT NULL,
32+
FOREIGN KEY (id_user) REFERENCES "user" (id_user),
33+
FOREIGN KEY (id_book) REFERENCES book (id_book)
2434
);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /