generated from pricelees/issue-pr-template
[#28] 쿠버네티스 환경 배포 #29
@ -4,7 +4,7 @@ spring:
|
|||||||
hibernate:
|
hibernate:
|
||||||
format_sql: true
|
format_sql: true
|
||||||
hibernate:
|
hibernate:
|
||||||
ddl-auto: create-drop
|
ddl-auto: validate
|
||||||
h2:
|
h2:
|
||||||
console:
|
console:
|
||||||
enabled: true
|
enabled: true
|
||||||
@ -15,6 +15,9 @@ spring:
|
|||||||
driver-class-name: org.h2.Driver
|
driver-class-name: org.h2.Driver
|
||||||
username: sa
|
username: sa
|
||||||
password:
|
password:
|
||||||
|
sql:
|
||||||
|
init:
|
||||||
|
schema-locations: classpath:schema/schema-h2.sql
|
||||||
|
|
||||||
security:
|
security:
|
||||||
jwt:
|
jwt:
|
||||||
|
|||||||
63
src/main/resources/schema/schema-h2.sql
Normal file
63
src/main/resources/schema/schema-h2.sql
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
create table if not exists members (
|
||||||
|
member_id bigint primary key,
|
||||||
|
email varchar(255) not null,
|
||||||
|
name varchar(255) not null,
|
||||||
|
password varchar(255) not null,
|
||||||
|
role varchar(20) not null,
|
||||||
|
created_at timestamp null,
|
||||||
|
last_modified_at timestamp null
|
||||||
|
);
|
||||||
|
|
||||||
|
create table if not exists themes (
|
||||||
|
theme_id bigint primary key,
|
||||||
|
description varchar(255) not null,
|
||||||
|
name varchar(255) not null,
|
||||||
|
thumbnail varchar(255) not null,
|
||||||
|
created_at timestamp null,
|
||||||
|
last_modified_at timestamp null
|
||||||
|
);
|
||||||
|
|
||||||
|
create table if not exists times (
|
||||||
|
time_id bigint primary key,
|
||||||
|
start_at time not null,
|
||||||
|
created_at timestamp null,
|
||||||
|
last_modified_at timestamp null
|
||||||
|
);
|
||||||
|
|
||||||
|
create table if not exists reservations (
|
||||||
|
reservation_id bigint primary key,
|
||||||
|
date date not null,
|
||||||
|
member_id bigint not null,
|
||||||
|
theme_id bigint not null,
|
||||||
|
time_id bigint not null,
|
||||||
|
status varchar(30) not null,
|
||||||
|
created_at timestamp null,
|
||||||
|
last_modified_at timestamp null,
|
||||||
|
constraint fk_reservations__themeId foreign key (theme_id) references themes (theme_id),
|
||||||
|
constraint fk_reservations__memberId foreign key (member_id) references members (member_id),
|
||||||
|
constraint fk_reservations__timeId foreign key (time_id) references times (time_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table if not exists payments (
|
||||||
|
payment_id bigint primary key,
|
||||||
|
approved_at timestamp not null,
|
||||||
|
reservation_id bigint not null,
|
||||||
|
total_amount bigint not null,
|
||||||
|
order_id varchar(255) not null,
|
||||||
|
payment_key varchar(255) not null,
|
||||||
|
created_at timestamp null,
|
||||||
|
last_modified_at timestamp null,
|
||||||
|
constraint uk_payments__reservationId unique (reservation_id),
|
||||||
|
constraint fk_payments__reservationId foreign key (reservation_id) references reservations (reservation_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table if not exists canceled_payments (
|
||||||
|
canceled_payment_id bigint primary key,
|
||||||
|
payment_key varchar(255) not null,
|
||||||
|
cancel_reason varchar(255) not null,
|
||||||
|
cancel_amount bigint not null,
|
||||||
|
approved_at timestamp not null,
|
||||||
|
canceled_at timestamp not null,
|
||||||
|
created_at timestamp null,
|
||||||
|
last_modified_at timestamp null
|
||||||
|
);
|
||||||
69
src/main/resources/schema/schema-mysql.sql
Normal file
69
src/main/resources/schema/schema-mysql.sql
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
create table if not exists members
|
||||||
|
(
|
||||||
|
member_id bigint primary key,
|
||||||
|
email varchar(255) not null,
|
||||||
|
name varchar(255) not null,
|
||||||
|
password varchar(255) not null,
|
||||||
|
role varchar(20) not null,
|
||||||
|
created_at datetime null,
|
||||||
|
last_modified_at datetime null
|
||||||
|
);
|
||||||
|
|
||||||
|
create table if not exists themes
|
||||||
|
(
|
||||||
|
theme_id bigint primary key,
|
||||||
|
description varchar(255) not null,
|
||||||
|
name varchar(255) not null,
|
||||||
|
thumbnail varchar(255) not null,
|
||||||
|
created_at datetime null,
|
||||||
|
last_modified_at datetime null
|
||||||
|
);
|
||||||
|
|
||||||
|
create table if not exists times
|
||||||
|
(
|
||||||
|
time_id bigint primary key,
|
||||||
|
start_at time(6) not null,
|
||||||
|
created_at datetime null,
|
||||||
|
last_modified_at datetime null
|
||||||
|
);
|
||||||
|
|
||||||
|
create table if not exists reservations
|
||||||
|
(
|
||||||
|
reservation_id bigint primary key,
|
||||||
|
date date not null,
|
||||||
|
member_id bigint not null,
|
||||||
|
theme_id bigint not null,
|
||||||
|
time_id bigint not null,
|
||||||
|
status varchar(30) not null,
|
||||||
|
created_at datetime null,
|
||||||
|
last_modified_at datetime null,
|
||||||
|
constraint fk_reservations__themeId foreign key (theme_id) references themes (theme_id),
|
||||||
|
constraint fk_reservations__memberId foreign key (member_id) references members (member_id),
|
||||||
|
constraint fk_reservations__timeId foreign key (time_id) references times (time_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table if not exists payments
|
||||||
|
(
|
||||||
|
payment_id bigint primary key,
|
||||||
|
approved_at datetime(6) not null,
|
||||||
|
reservation_id bigint not null,
|
||||||
|
total_amount bigint not null,
|
||||||
|
order_id varchar(255) not null,
|
||||||
|
payment_key varchar(255) not null,
|
||||||
|
created_at datetime null,
|
||||||
|
last_modified_at datetime null,
|
||||||
|
constraint uk_payments__reservationId unique (reservation_id),
|
||||||
|
constraint fk_payments__reservationId foreign key (reservation_id) references reservations (reservation_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table if not exists canceled_payments
|
||||||
|
(
|
||||||
|
canceled_payment_id bigint primary key,
|
||||||
|
payment_key varchar(255) not null,
|
||||||
|
cancel_reason varchar(255) not null,
|
||||||
|
cancel_amount bigint not null,
|
||||||
|
approved_at datetime(6) not null,
|
||||||
|
canceled_at datetime(6) not null,
|
||||||
|
created_at datetime null,
|
||||||
|
last_modified_at datetime null
|
||||||
|
);
|
||||||
Loading…
x
Reference in New Issue
Block a user