feat: add Firearm and Modification entities with database schema
This commit is contained in:
@@ -1,3 +1,46 @@
|
||||
spring:
|
||||
application:
|
||||
name: delta-force-guide-server
|
||||
name: delta-force-guide
|
||||
cache:
|
||||
type: redis
|
||||
redis:
|
||||
time-to-live: PT2H
|
||||
data:
|
||||
redis:
|
||||
repositories:
|
||||
# Disable redis repositories
|
||||
enabled: false
|
||||
jta:
|
||||
# Disable JTA support
|
||||
enabled: false
|
||||
jpa:
|
||||
properties:
|
||||
hibernate:
|
||||
transaction:
|
||||
jta:
|
||||
# No need to use distributed transaction manager for 1 datasource.
|
||||
platform: org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform
|
||||
hibernate:
|
||||
ddl-auto: none
|
||||
open-in-view: false
|
||||
datasource:
|
||||
hikari:
|
||||
minimum-idle: 1
|
||||
maximum-pool-size: 10
|
||||
flyway:
|
||||
enabled: true
|
||||
baseline-on-migrate: true
|
||||
|
||||
mybatis:
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
|
||||
map-underscore-to-camel-case: true
|
||||
type-aliases-package: com.onixbyte.deltaforceguide.domain.entity
|
||||
type-handlers-package: com.onixbyte.deltaforceguide.mapper.handler
|
||||
mapper-locations: classpath:/mapper/*.xml
|
||||
|
||||
logging:
|
||||
level:
|
||||
org.hibernate:
|
||||
orm.connections.pooling: off
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
DROP TABLE IF EXISTS firearm CASCADE;
|
||||
DROP TABLE IF EXISTS modification CASCADE;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS firearm
|
||||
(
|
||||
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(64) NOT NULL,
|
||||
type INT NOT NULL,
|
||||
level INT NOT NULL,
|
||||
review TEXT NULL
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS modification
|
||||
(
|
||||
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
firearm_id BIGINT NOT NULL,
|
||||
name VARCHAR(64) NOT NULL,
|
||||
code VARCHAR(64) NOT NULL,
|
||||
tags JSON NULL,
|
||||
note TEXT NULL,
|
||||
author VARCHAR(64) NULL,
|
||||
video_url VARCHAR(512) NULL,
|
||||
CONSTRAINT fk_modification_firearm
|
||||
FOREIGN KEY (firearm_id)
|
||||
REFERENCES firearm (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE RESTRICT
|
||||
);
|
||||
|
||||
CREATE INDEX idx_modification_firearm_id ON modification (firearm_id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user