From 035028123b785bb1ee7b12d9c982c25cf24a3399 Mon Sep 17 00:00:00 2001 From: hyeesw Date: Wed, 31 Jul 2024 00:34:09 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[feat]=20SQL=20script=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 From 141be70b9ce2f6f8f8f20a4b7394d185a2cb18c3 Mon Sep 17 00:00:00 2001 From: hyeesw Date: Wed, 31 Jul 2024 00:36:49 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[feat]=20data.sql=20=EC=83=98=ED=94=8C=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/data.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/main/resources/data.sql 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');