With Computer/Spring Starter Project

[intelliJ] TDD에서 실행쿼리 형태 확인

s:tardust 2020. 2. 7. 16:53
[책] 스프링부트와 AWS로 혼자 구현하는 웹서비스

 

 

resources 디렉토리 아래에 application.properties 파일 생성

(책은 아이콘이 다른거같은데, 나는 걍 file로 생성해줌)

spring.jpa.show_sql=true

 

변경전

Hibernate: create table posts (id bigint generated by default as identity, author varchar(255), content TEXT not null, title varchar(500) not null, primary key (id))

H2 쿼리문법 적용됨 - MySQL로 변경원할경우, application.properties에서 추가 설정

 

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect

 

변경후

Hibernate: create table posts (id bigint not null auto_increment, author varchar(255), content TEXT not null, title varchar(500) not null, primary key (id)) engine=InnoDB

반응형