Compare commits

...

2 Commits

Author SHA1 Message Date
Artur Oliveira 2980248669 feat: changes from h2 to postgres 2025-12-15 22:00:00 -03:00
Artur Oliveira d06c103a66 chore: ignore env files 2025-12-15 21:59:34 -03:00
5 changed files with 30 additions and 11 deletions

8
.gitignore vendored
View File

@ -54,4 +54,10 @@ atlassian-ide-plugin.xml
cached-antora-playbook.yml
node_modules
/.kotlin/
/.kotlin/
### Environment ###
.env
*.env
**/*.env

6
backend/.gitignore vendored
View File

@ -36,6 +36,10 @@ out/
### VS Code ###
.vscode/
### Environment ###
.env
*.env
**/*.env
### Database ###
data/

View File

@ -34,6 +34,7 @@ dependencies {
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'org.postgresql:postgresql'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.6.3'
testImplementation 'org.springframework.boot:spring-boot-starter-data-jdbc-test'

View File

@ -1,17 +1,24 @@
spring:
application:
name: backend
sql:
init:
mode: always
schema-locations: classpath:schema.sql
datasource:
url: jdbc:h2:file:./data/db
driver-class-name: org.h2.Driver
username: sa
password:
url: jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_NAME}
username: ${DB_USER}
password: ${DB_PASSWD}
jpa:
hibernate:
ddl-auto: update
database-platform: org.hibernate.dialect.H2Dialect
h2:
console:
enabled: true
path: /h2-console
show-sql: true
properties:
hibernate:
dialect: org.hibernate.dialect.PostgreSQLDialect
format_sql: true
default_schema: server-manager

View File

@ -0,0 +1 @@
CREATE SCHEMA IF NOT EXISTS "server-manager";