Checkpoint: Add series and awards metadata

This commit is contained in:
aditya.chandel
2025-01-25 16:21:29 -07:00
parent a188a5f795
commit 775f341c7b
19 changed files with 395 additions and 20 deletions
@@ -15,7 +15,7 @@ spring:
name: booklore-api
datasource:
driver-class-name: org.h2.Driver
url: 'jdbc:h2:~/my-library-temp/config/local/db/booklore;AUTO_SERVER=TRUE'
url: 'jdbc:h2:tcp://localhost:9092/~/my-library-temp/config/local/db/booklore'
username: sa
password: password
jpa:
@@ -52,9 +52,24 @@ CREATE TABLE IF NOT EXISTS book_metadata
review_count INT,
cover VARCHAR(255),
cover_updated_on TIMESTAMP NULL,
series_name VARCHAR(255),
series_number INT,
series_total INT,
CONSTRAINT fk_book_metadata FOREIGN KEY (book_id) REFERENCES book (id) ON DELETE CASCADE
);
CREATE TABLE book_award
(
id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
book_id BIGINT NOT NULL,
name VARCHAR(255) NOT NULL,
awarded_at TIMESTAMP NOT NULL,
category VARCHAR(255) NOT NULL,
designation VARCHAR(255) NOT NULL,
CONSTRAINT fk_book_awards_book FOREIGN KEY (book_id) REFERENCES book (id) ON DELETE CASCADE,
CONSTRAINT unique_book_award UNIQUE (book_id, name, category, awarded_at)
);
CREATE TABLE IF NOT EXISTS author
(
id BIGINT AUTO_INCREMENT PRIMARY KEY,