Skip to content

Commit

Permalink
Feat: 개발 환경, 테스트 환경 분리 - #14
Browse files Browse the repository at this point in the history
- 테스트 환경을 분리하여 H2 DB 연결
  • Loading branch information
donggi-lee-bit committed Apr 21, 2022
1 parent a94e7d2 commit 7d381c8
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
21 changes: 21 additions & 0 deletions BE/src/test/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
spring:
datasource:
driverClassName: org.h2.Driver
url: jdbc:h2:mem:testdb
username: sa
sql:
init:
mode: always
schema-locations: classpath:testDB/schema.sql
# data-locations: classpath:testDB/data.sql
h2:
console:
enabled: true
path: /h2-console
mvc:
pathmatch:
matching-strategy: ant_path_matcher

logging:
level:
web: DEBUG
30 changes: 30 additions & 0 deletions BE/src/test/resources/testDB/schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
DROP TABLE IF EXISTS dish;
CREATE TABLE dish
(
dish_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255) NULL,
description VARCHAR(255) NULL,
normal_price DECIMAL NULL,
sale_price DECIMAL NULL,
badge VARCHAR(255) NULL,
delivery_type VARCHAR(255) NULL,
thumbnail VARCHAR(255) NULL,
category_id BIGINT NOT NULL,
dish_status VARCHAR(255) NULL
);


DROP TABLE IF EXISTS category;
CREATE TABLE category
(
category_id BIGINT NOT NULL PRIMARY KEY,
title VARCHAR(255)
);

DROP TABLE IF EXISTS users;
CREATE TABLE users
(
user_id BIGINT NOT NULL PRIMARY KEY,
login_id BIGINT NOT NULL,
password VARCHAR(60) NOT NULL
);

0 comments on commit 7d381c8

Please sign in to comment.