h2 옵션 추가
h2 로 테스트 DB를 사용하면 기본으로 테이블 이름이 모두 대문자가 된다.
이 옵션을 해제하려면, application.yml 의 datasource 설정에 DATABASE_TO_UPPER=false 옵션을 추가하면 된다.
datasource:
driver-class-name: org.h2.Driver
url: jdbc:h2:~/testDB;DATABASE_TO_UPPER=false
username: sa
password:
이렇게 설정해주면 /h2-console에 접속했을때 내가 의도한 테이블명이 되어있는 것을 확인할 수 있다.(그냥 기본값이 false이면 안되는 걸까..)
참고
H2 "runscript" command turns all table names into uppercase
I have a sql script (it is just schema definition). The script is a modified version (getting rid of the bad characters h2 doesn't like) of a mysql dumb. The script runs and the schema is inserte...
stackoverflow.com
'Java,Kotlin,SpringBoot' 카테고리의 다른 글
[SpringBoot] AbstractAggregateRoot로 DomainEvent 발행하기 (3) | 2024.11.27 |
---|---|
[SpringBoot] @Async로 비동기 작업 처리하기 (1) | 2024.09.19 |
[SpringBoot] JPA에서 Enum 값 다루기(AttributeConverter) (3) | 2024.09.13 |
[Java] ExecutorService와 Future (2) | 2024.08.20 |
[SpringBoot] MockK 사용하기 (0) | 2023.07.09 |