application.properties
μ€μ νμΌ μμ½
# μ ν리μΌμ΄μ
μ΄λ¦
spring.application.name=springboot-secret-diary
# πΎ H2 μ½μ μ€μ
spring.h2.console.enabled=true # μΉμμ H2 DB μ½μ μ¬μ© κ°λ₯
spring.h2.console.path=/h2-console # μ½μ μ μ κ²½λ‘: <http://localhost:8080/h2-console>
# π λ°μ΄ν°λ² μ΄μ€ μ€μ (H2 λ©λͺ¨λ¦¬ DB μ¬μ©)
spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1
spring.datasource.username=sa
spring.datasource.password=
# ποΈ JPA μ€μ
spring.jpa.hibernate.ddl-auto=update # μλ² μ€ν μ DB ν
μ΄λΈ μλ μ
λ°μ΄νΈ
spring.jpa.show-sql=true # μ€νλλ SQL 쿼리 μ½μ μΆλ ₯
νλͺ© | μ€λͺ |
---|---|
spring.application.name |
μ΄ νλ‘μ νΈμ μ΄λ¦ (λ‘κ·Έλ λͺ¨λν°λ§μμ μ¬μ©) |
spring.h2.console.enabled |
H2 μ½μ μΉ μ κ·Ό νμ© μ¬λΆ (true λ‘ μ€μ μ μ μ κ°λ₯) |
spring.h2.console.path |
H2 μ½μ μ κ·Ό κ²½λ‘ μ§μ (μ: /h2-console ) |
spring.datasource.url |
H2 λ©λͺ¨λ¦¬ DB μ μ μ£Όμ. DB_CLOSE_DELAY=-1 μ μ± μ’
λ£ μ κΉμ§ λ©λͺ¨λ¦¬ μ μ§ |
spring.datasource.username / password |
DB λ‘κ·ΈμΈ μ 보 (H2 κΈ°λ³Έμ sa /λΉ λΉλ°λ²νΈ) |
spring.jpa.hibernate.ddl-auto=update |
μν°ν° ν΄λμ€ κΈ°λ°μΌλ‘ DB μ€ν€λ§ μλ μμ±/μ λ°μ΄νΈ |
spring.jpa.show-sql=true |
μ€μ μ€νλλ SQLλ¬Έμ μ½μμ μΆλ ₯ (λλ²κΉ μ λμλ¨) |
ddl-auto=update
λ κ°λ° λ¨κ³μμλ νΈνμ§λ§, μ΄μ νκ²½μμλ μνν μ μμΌλ―λ‘ validate
λ none
μΌλ‘ λ°κΎΈλ κ² μ’λ€.μ€μ ꡬλ μμ