fix: database errors and version on status
This commit is contained in:
parent
c2a6c52141
commit
78bf1be42b
6 changed files with 43 additions and 5 deletions
11
backend/.env.example
Normal file
11
backend/.env.example
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
# Database
|
||||||
|
DB_USER=beetask
|
||||||
|
DB_PASSWORD=beetask
|
||||||
|
DB_URL=jdbc:postgresql://localhost:5432/beetask
|
||||||
|
|
||||||
|
# Optional overrides
|
||||||
|
# QUARKUS_HTTP_PORT=8080
|
||||||
|
# QUARKUS_HTTP_CORS_ORIGINS=http://localhost:5173
|
||||||
|
# MP_JWT_VERIFY_ISSUER=https://beetech.net
|
||||||
|
# SMALLRYE_JWT_SIGN_KEY_LOCATION=privateKey.pem
|
||||||
|
# MP_JWT_VERIFY_PUBLICKEY_LOCATION=publicKey.pem
|
||||||
|
|
@ -67,10 +67,6 @@
|
||||||
<groupId>io.quarkus</groupId>
|
<groupId>io.quarkus</groupId>
|
||||||
<artifactId>quarkus-jdbc-postgresql</artifactId>
|
<artifactId>quarkus-jdbc-postgresql</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>io.quarkus</groupId>
|
|
||||||
<artifactId>quarkus-jdbc-h2</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.quarkus</groupId>
|
<groupId>io.quarkus</groupId>
|
||||||
<artifactId>quarkus-hibernate-validator</artifactId>
|
<artifactId>quarkus-hibernate-validator</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
package net.beetechgroup.beetask.frameworks.health;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import org.eclipse.microprofile.config.inject.ConfigProperty;
|
||||||
|
import org.eclipse.microprofile.health.HealthCheck;
|
||||||
|
import org.eclipse.microprofile.health.HealthCheckResponse;
|
||||||
|
import org.eclipse.microprofile.health.Readiness;
|
||||||
|
|
||||||
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
|
||||||
|
@Readiness
|
||||||
|
@ApplicationScoped
|
||||||
|
public class BackendVersionHealthCheck implements HealthCheck {
|
||||||
|
|
||||||
|
@ConfigProperty(name = "quarkus.application.version")
|
||||||
|
Optional<String> applicationVersion;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HealthCheckResponse call() {
|
||||||
|
return HealthCheckResponse.named("backend-version")
|
||||||
|
.up()
|
||||||
|
.withData("version", applicationVersion.orElse("unknown"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,7 @@ package net.beetechgroup.beetask.frameworks.persistence.entities;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import jakarta.persistence.CascadeType;
|
import jakarta.persistence.CascadeType;
|
||||||
|
import jakarta.persistence.Column;
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
import jakarta.persistence.EnumType;
|
import jakarta.persistence.EnumType;
|
||||||
import jakarta.persistence.Enumerated;
|
import jakarta.persistence.Enumerated;
|
||||||
|
|
@ -25,6 +26,7 @@ public class TaskEntity {
|
||||||
private String description;
|
private String description;
|
||||||
@Enumerated(EnumType.STRING)
|
@Enumerated(EnumType.STRING)
|
||||||
private TaskStatus status;
|
private TaskStatus status;
|
||||||
|
@Column(name = "finished_at")
|
||||||
private java.time.LocalDateTime finishedAt;
|
private java.time.LocalDateTime finishedAt;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package net.beetechgroup.beetask.frameworks.persistence.entities;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
import jakarta.persistence.GeneratedValue;
|
import jakarta.persistence.GeneratedValue;
|
||||||
import jakarta.persistence.GenerationType;
|
import jakarta.persistence.GenerationType;
|
||||||
|
|
@ -17,7 +18,9 @@ public class TaskHistoryItemEntity {
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "start_at")
|
||||||
private LocalDateTime startAt;
|
private LocalDateTime startAt;
|
||||||
|
@Column(name = "end_at")
|
||||||
private LocalDateTime endAt;
|
private LocalDateTime endAt;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ quarkus.datasource.password=${DB_PASSWORD:beetask}
|
||||||
quarkus.datasource.jdbc.url=${DB_URL:jdbc:postgresql://localhost:5432/beetask}
|
quarkus.datasource.jdbc.url=${DB_URL:jdbc:postgresql://localhost:5432/beetask}
|
||||||
|
|
||||||
quarkus.flyway.migrate-at-start=true
|
quarkus.flyway.migrate-at-start=true
|
||||||
quarkus.hibernate-orm.database.generation=validate
|
quarkus.hibernate-orm.schema-management.strategy=validate
|
||||||
|
|
||||||
# Swagger & OpenAPI
|
# Swagger & OpenAPI
|
||||||
quarkus.smallrye-openapi.path=/openapi
|
quarkus.smallrye-openapi.path=/openapi
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue