diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index b77b16e3..fd9faa38 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -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 diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql new file mode 100644 index 00000000..56b1581b --- /dev/null +++ b/src/main/resources/data.sql @@ -0,0 +1,3 @@ +insert into user (login_id, password, sex, birth_date, email, phone, reg_date) +values ('user1', 'useruser1!', '1', '1990-01-01', 'user1@gmail.com', '010-1111-1111', '2024-06-10'), + ('user2', 'useruser2!', '2', '2000-03-16', 'user2@gmail.com', '010-2222-2222', '2024-07-22');