-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
create database if not exists ticket; | ||
|
||
use ticket; | ||
|
||
create table if not exists member | ||
( | ||
id bigint not null auto_increment, | ||
name varchar(255), | ||
primary key (id) | ||
) engine = InnoDB; | ||
|
||
create table if not exists member_ticket | ||
( | ||
id bigint not null auto_increment, | ||
member_id bigint, | ||
ticket_id bigint, | ||
primary key (id) | ||
) engine = InnoDB; | ||
|
||
create table if not exists ticket | ||
( | ||
id bigint not null auto_increment, | ||
quantity bigint, | ||
name varchar(255), | ||
primary key (id) | ||
) engine = InnoDB; | ||
|
||
alter table member_ticket | ||
add constraint FKomlguxfcardby8919wyyaxcw3 | ||
foreign key (member_id) | ||
references member (id); | ||
|
||
alter table member_ticket | ||
add constraint FK4ri79r4gubettxo63roi3ksfj | ||
foreign key (ticket_id) | ||
references ticket (id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: "3.9" | ||
services: | ||
db: | ||
image: mysql:8.0.28 | ||
platform: linux/x86_64 | ||
restart: always | ||
ports: | ||
- "13306:3306" | ||
environment: | ||
MYSQL_ROOT_PASSWORD: root | ||
MYSQL_DATABASE: ticket | ||
MYSQL_ROOT_USER: root | ||
MYSQL_PASSWORD: root | ||
TZ: Asia/Seoul | ||
volumes: | ||
- ./db/mysql/data:/var/lib/mysql | ||
- ./db/mysql/init/schema.sql:/docker-entrypoint-initdb.d/schema.sql |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
spring: | ||
datasource: | ||
driver-class-name: com.mysql.cj.jdbc.Driver | ||
url: jdbc:mysql://localhost:13306/ticket?useSSL=false&serverTimezone=Asia/Seoul&characterEncoding=UTF-8&allowPublicKeyRetrieval=true | ||
username: root | ||
password: root | ||
|
||
jpa: | ||
properties: | ||
hibernate: | ||
dialect: org.hibernate.dialect.MySQL8Dialect | ||
format_sql: true | ||
show_sql: true | ||
hbm2ddl.auto: validate |