Initial commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
app:
|
||||
path-book: '/Users/aditya.chandel/my-library-temp/books'
|
||||
path-config: '/Users/aditya.chandel/my-library-temp/config'
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: booklore-api
|
||||
datasource:
|
||||
driver-class-name: org.mariadb.jdbc.Driver
|
||||
url: ${SOLITUDE_API_MARIADB_URL:jdbc:mariadb://localhost:3306/booklore}
|
||||
username: ${SOLITUDE_API_MARIADB_USERNAME:root}
|
||||
password: ${SOLITUDE_API_MARIADB_PASSWORD:cfcNEBdUm6QerR6oo2UM}
|
||||
jpa:
|
||||
hibernate:
|
||||
naming:
|
||||
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
|
||||
show-sql: false
|
||||
properties:
|
||||
hibernate:
|
||||
jdbc:
|
||||
batch_size: 500
|
||||
order_inserts: true
|
||||
order_updates: true
|
||||
flyway:
|
||||
enabled: true
|
||||
locations: classpath:db/migration
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: INFO
|
||||
org.apache.fontbox: ERROR
|
||||
org.apache.pdfbox: ERROR
|
||||
@@ -0,0 +1,43 @@
|
||||
CREATE TABLE IF NOT EXISTS library
|
||||
(
|
||||
id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(255) UNIQUE NOT NULL,
|
||||
paths BLOB
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS book
|
||||
(
|
||||
id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||
title VARCHAR(255),
|
||||
file_name VARCHAR(255) NOT NULL,
|
||||
library_id BIGINT NOT NULL,
|
||||
path VARCHAR(1000) NOT NULL,
|
||||
CONSTRAINT fk_library FOREIGN KEY (library_id) REFERENCES library (id) ON DELETE CASCADE,
|
||||
CONSTRAINT unique_file_library UNIQUE (file_name, library_id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS author
|
||||
(
|
||||
id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(255),
|
||||
CONSTRAINT unique_name UNIQUE (name)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS book_author_mapping
|
||||
(
|
||||
book_id BIGINT NOT NULL,
|
||||
author_id BIGINT NOT NULL,
|
||||
CONSTRAINT fk_book_author_mapping_book FOREIGN KEY (book_id) REFERENCES book (id) ON DELETE CASCADE,
|
||||
CONSTRAINT fk_book_author_mapping_author FOREIGN KEY (author_id) REFERENCES author (id),
|
||||
CONSTRAINT unique_book_author UNIQUE (book_id, author_id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS book_viewer_setting
|
||||
(
|
||||
book_id BIGINT PRIMARY KEY,
|
||||
page_number INT DEFAULT 1,
|
||||
zoom VARCHAR(32) DEFAULT 'page-fit',
|
||||
sidebar_visible BOOLEAN DEFAULT false,
|
||||
spread VARCHAR(32) DEFAULT 'off',
|
||||
CONSTRAINT fk_book_viewer_setting FOREIGN KEY (book_id) REFERENCES book (id) ON DELETE CASCADE
|
||||
);
|
||||
Reference in New Issue
Block a user