cami-la / academia-digital

Projeto de LAB: Conhendo o projeto Spring data JPA com Java na prática

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DataBase H2

Anderson0512 opened this issue · comments

Olá Camila, tudo bem com vc?

Uma dúvida sobre o banco de dados. Posso entregar o projeto usando o banco de dados H2?
Minha pergunta é devido a nível de estudos para outras pessoas, fica mais fácil sem precisar ter o PGAdmin. Caso não possa tudo bem, não tem problema.

Até breve.

Oi, @Anderson0512. Sim! Sem problema algum.
Pode substituir pelo H2. Segue as instruções tanto da dependência do pom.xml quanto do arquivo application.yml

ATENÇÃO NA IDENTAÇÃO DO ARQUIVO APPLICATION.YML

spring:
  datasource:
    url: jdbc:h2:mem:test
    username: sa
    password:
  jpa:
    show-sql: true
    hibernate:
      ddl-auto: update
    properties:
      hibernate.format_sql: true
  h2:
    console:
      enabled: true
      path: /h2-console
      settings:
        trace: false
        web-allow-others: false
<!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
<dependency>
    <groupId>com.h2database</groupId>
    <artifactId>h2</artifactId>
    <scope>runtime</scope>
</dependency>