Add flyway initial schema and database setup

This commit is contained in:
litoral05
2026-05-05 10:04:51 +01:00
parent 5dd2c479c7
commit 2b74db43dd
4 changed files with 47 additions and 0 deletions
+3
View File
@@ -31,3 +31,6 @@ build/
### VS Code ###
.vscode/
### Postgres ###
postgres-data/
+12
View File
@@ -0,0 +1,12 @@
services:
postgres:
image: postgres:16
container_name: lr-openvpn-postgres
environment:
POSTGRES_DB: lr_openvpn
POSTGRES_USER: lr_openvpn
POSTGRES_PASSWORD: lr_openvpn_dev
ports:
- "5432:5432"
volumes:
- ./postgres-data:/var/lib/postgresql/data
+22
View File
@@ -1,3 +1,25 @@
spring:
application:
name: lr-openvpn-backend
datasource:
url: jdbc:postgresql://localhost:5432/lr_openvpn
username: lr_openvpn
password: lr_openvpn_dev
jpa:
hibernate:
ddl-auto: validate
open-in-view: false
flyway:
enabled: true
server:
port: 8080
management:
endpoints:
web:
exposure:
include: health,info
@@ -0,0 +1,10 @@
CREATE TABLE vps_servers (
id UUID PRIMARY KEY,
name VARCHAR(120) NOT NULL,
host VARCHAR(255) NOT NULL,
ssh_port INTEGER NOT NULL DEFAULT 22,
ssh_user VARCHAR(120) NOT NULL,
status VARCHAR(40) NOT NULL DEFAULT 'UNKNOWN',
created_at TIMESTAMP NOT NULL DEFAULT now(),
updated_at TIMESTAMP NOT NULL DEFAULT now()
);