From 2a0d097ce7cf47097ff84d295355bbbfe883694e Mon Sep 17 00:00:00 2001 From: Nano Taboada Date: Mon, 8 Jun 2026 16:52:16 -0300 Subject: [PATCH 1/2] docs(claude): document Flyway migrations in CLAUDE.md Add Flyway to Tech Stack, add db/migration/ to the structure diagram, and fix the "Modify schema" workflow to use versioned migration files instead of manually editing the SQLite file. Produced with the CLAUDE.md Management plugin (https://claude.com/plugins/claude-md-management). Co-authored-by: Claude Sonnet 4.6 --- CHANGELOG.md | 7 +++++++ CLAUDE.md | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8691c8..f85c70f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,13 @@ Release names follow the **historic football clubs** naming convention (A–Z): ### Changed +- Update `CLAUDE.md`: add Flyway to Tech Stack, add `db/migration/` to structure + diagram, fix "Modify schema" workflow to use versioned Flyway migrations instead + of manually editing the SQLite file — produced with the + [CLAUDE.md Management plugin](https://claude.com/plugins/claude-md-management) + +### Changed + - Consolidate project documentation into `CLAUDE.md` as the single source of truth; add Invariants and Architecture Decision Records sections; extend Pre-commit Checks with ADR update requirement (#335) diff --git a/CLAUDE.md b/CLAUDE.md index f252ba6..bec05dd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -14,6 +14,7 @@ REST API for managing football players built with Java and Spring Boot. Implemen - **Validation**: Bean Validation (JSR-380) - **Caching**: Spring `@Cacheable` (simple in-memory, no expiry) - **Mapping**: ModelMapper +- **Migrations**: Flyway (versioned SQL under `db/migration/`; disabled in tests — tests use Spring SQL init instead) - **Logging**: SLF4J - **Testing**: JUnit 5 + AssertJ + MockMvc + Mockito - **Coverage**: JaCoCo @@ -31,9 +32,10 @@ src/main/java/ ├── models/ — Player entity + DTOs └── converters/ — JPA AttributeConverter for ISO-8601 date handling src/main/resources/ — application.properties, Logback config +src/main/resources/db/migration/ — Flyway versioned SQL (V1 schema, V2+V3 seed data; add V{N}__ here to change schema) src/test/java/ — test classes mirroring main structure -src/test/resources/ — test config, schema (ddl.sql), seed data (dml.sql) -storage/ — SQLite database file (runtime) +src/test/resources/ — test config, schema (ddl.sql), seed data (dml.sql); Flyway disabled in tests +storage/ — SQLite database file (runtime, created and populated by Flyway on first start) ``` **Layer rule**: `Controller → Service → Repository → JPA`. Controllers must not access repositories directly. Business logic must not live in controllers. @@ -133,7 +135,7 @@ This project uses Spec-Driven Development (SDD): discuss in Plan mode first, cre **Add an endpoint**: Define DTO in `models/` with Bean Validation → add service method in `services/` with `@Transactional` → create controller endpoint with `@Operation` annotation → add tests → run `./mvnw clean test jacoco:report`. -**Modify schema**: Update `@Entity` in `models/Player.java` → update DTOs if API changes → manually update `storage/players-sqlite3.db` (preserve 26 players) → update service, repository, and tests → run `./mvnw clean test`. +**Modify schema**: Create a new Flyway migration `src/main/resources/db/migration/V{N}__description.sql` (production path) → update `@Entity` in `models/Player.java` → update DTOs if API changes → also update `src/test/resources/ddl.sql` and `dml.sql` (tests use Spring SQL init, not Flyway) → update service, repository, and tests → run `./mvnw clean test`. Do not manually edit the SQLite file in `storage/`; Flyway owns it. **After completing work**: Suggest a branch name (e.g. `feat/add-player-stats`) and a commit message following Conventional Commits including co-author line: From 67fb3ff288124ee356885b1e5b6b07a821c7d321 Mon Sep 17 00:00:00 2001 From: Nano Taboada Date: Mon, 8 Jun 2026 17:01:08 -0300 Subject: [PATCH 2/2] fix(changelog): merge duplicate ### Changed headings in Unreleased Co-authored-by: Claude Sonnet 4.6 --- CHANGELOG.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f85c70f..955f8a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,9 +50,6 @@ Release names follow the **historic football clubs** naming convention (A–Z): diagram, fix "Modify schema" workflow to use versioned Flyway migrations instead of manually editing the SQLite file — produced with the [CLAUDE.md Management plugin](https://claude.com/plugins/claude-md-management) - -### Changed - - Consolidate project documentation into `CLAUDE.md` as the single source of truth; add Invariants and Architecture Decision Records sections; extend Pre-commit Checks with ADR update requirement (#335)