Skip to content

Commit

Permalink
Merge pull request #21 from BOOK-TALK/#20-data.sql
Browse files Browse the repository at this point in the history
#20 data.sql
  • Loading branch information
chanwoo7 authored Jul 30, 2024
2 parents c7f067a + 141be70 commit d61405b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ spring:

jpa:
hibernate:
ddl-auto: create
ddl-auto: create # entity 기반 스키마 생성
properties:
hibernate:
dialect: org.hibernate.dialect.MySQL8Dialect
format_sql: true
open-in-view: false
defer-datasource-initialization: true # ddl-auto 실행 후 data.sql 로 데이터 삽입

# flyway:
# enabled: true
# baseline-on-migrate: true
sql: #data.sql 의 DDL 실행
init:
mode: always
3 changes: 3 additions & 0 deletions src/main/resources/data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
insert into user (login_id, password, sex, birth_date, email, phone, reg_date)
values ('user1', 'useruser1!', '1', '1990-01-01', '[email protected]', '010-1111-1111', '2024-06-10'),
('user2', 'useruser2!', '2', '2000-03-16', '[email protected]', '010-2222-2222', '2024-07-22');

0 comments on commit d61405b

Please sign in to comment.