T-4: add JPA, Liquibase, Testcontainers, and deployment docs
Set up development infrastructure for TDD: JPA + Liquibase for database migrations, Testcontainers for integration tests against real PostgreSQL, profile-based configuration (prod/local), and README deployment documentation with docker-compose example. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
# Local development database
|
||||
# Copy this file to application-local.properties and adjust as needed.
|
||||
# Start with: ./mvnw spring-boot:run -Dspring-boot.run.profiles=local
|
||||
spring.datasource.url=jdbc:postgresql://localhost:5432/fete
|
||||
spring.datasource.username=fete
|
||||
spring.datasource.password=fete
|
||||
4
backend/src/main/resources/application-prod.properties
Normal file
4
backend/src/main/resources/application-prod.properties
Normal file
@@ -0,0 +1,4 @@
|
||||
# Database (required)
|
||||
spring.datasource.url=${DATABASE_URL}
|
||||
spring.datasource.username=${DATABASE_USERNAME}
|
||||
spring.datasource.password=${DATABASE_PASSWORD}
|
||||
@@ -1,4 +1,12 @@
|
||||
spring.application.name=fete
|
||||
|
||||
# JPA
|
||||
spring.jpa.hibernate.ddl-auto=validate
|
||||
spring.jpa.open-in-view=false
|
||||
|
||||
# Liquibase
|
||||
spring.liquibase.change-log=classpath:db/changelog/db.changelog-master.xml
|
||||
|
||||
# Actuator
|
||||
management.endpoints.web.exposure.include=health
|
||||
management.endpoint.health.show-details=never
|
||||
|
||||
12
backend/src/main/resources/db/changelog/000-baseline.xml
Normal file
12
backend/src/main/resources/db/changelog/000-baseline.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<databaseChangeLog
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
|
||||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
|
||||
|
||||
<changeSet id="000-baseline" author="nitrix">
|
||||
<comment>Baseline changeset — Liquibase tooling verification</comment>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<databaseChangeLog
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
|
||||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
|
||||
|
||||
<include file="db/changelog/000-baseline.xml"/>
|
||||
|
||||
</databaseChangeLog>
|
||||
Reference in New Issue
Block a user