313-frameworks-spring-db-migrations-flyway

Solid

Use when you need to add or review Flyway database migrations in a Spring Boot application — Maven dependencies, db/migration scripts, spring.flyway.* configuration, baseline and validation, and alignment with JDBC or Spring Data JDBC. Part of the skills-for-java project

AI & Automation 393 stars 78 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 89/100

Stars 20%
86
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
74
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Spring — Database migrations (Flyway) Apply Flyway migration guidelines for Spring Boot. **What is covered in this Skill?** - flyway-core and database-specific Flyway modules (e.g. PostgreSQL) with Spring Boot BOM - Versioned SQL under `src/main/resources/db/migration` (`V{version}__{description}.sql`) - `spring.flyway.*` properties: locations, baseline-on-migrate, validate-on-migrate - Optional Java migrations (`BaseJavaMigration`) for data backfills - Forward-only discipline: do not rewrite applied migrations in shared environments - Coordination with `@311-frameworks-spring-jdbc` and `@312-frameworks-spring-data-jdbc` **Scope:** Apply recommendations based on the reference rules and good/bad examples. ## Constraints Before applying Flyway or SQL changes, ensure the project compiles. After improvements, run full verification. - **MANDATORY**: Run `./mvnw compile` or `mvn compile` before applying any change - **SAFETY**: If compilation fails, stop immediately - **VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after applying improvements - **BEFORE APPLYING**: Read the reference for detailed rules and good/bad patterns ## When to use this skill - Add or review Flyway migrations in a Spring Boot project - Configure spring.flyway or db/migration layout ## Reference For detailed guidance, examples, and constraints, see [references/313-frameworks-spring-db-migrations-flyway.md](references/313-frameworks-spring-db-migrations-flyway.md).

Details

Author
jabrena
Repository
jabrena/cursor-rules-java
Created
1 years ago
Last Updated
today
Language
Java
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

513-frameworks-micronaut-db-migrations-flyway

Use when you need to add or review Flyway database migrations in a Micronaut application — micronaut-flyway, db/migration scripts, flyway.datasources.* configuration, and alignment with JDBC or Micronaut Data. Part of the skills-for-java project

393 Updated today
jabrena
AI & Automation Solid

413-frameworks-quarkus-db-migrations-flyway

Use when you need to add or review Flyway database migrations in a Quarkus application — quarkus-flyway extension, db/migration scripts, quarkus.flyway.* configuration, migrate-at-start, and alignment with JDBC or Panache. Part of the skills-for-java project

393 Updated today
jabrena
AI & Automation Solid

311-frameworks-spring-jdbc

Use when you need to write or review programmatic JDBC with Spring — including JdbcClient (Spring Framework 7+) as the default API, JdbcTemplate only where batch/streaming APIs require JdbcOperations, NamedParameterJdbcTemplate for legacy named-param code, parameterized SQL, RowMapper mapping to records, batch operations, transactions, safe handling of generated keys, DataAccessException handling, read-only transactions, streaming large result sets, and @JdbcTest slice testing. This should trigger for requests such as Review Java code for Spring JDBC (JdbcTemplate, JdbcClient, NamedParameterJdbcTemplate); Apply best practices for Spring JDBC data access in Java code; Detect and fix SQL injection risks in JDBC code; Improve transaction boundaries or exception handling for JDBC operations. Part of cursor-rules-java project

393 Updated today
jabrena
AI & Automation Solid

303-frameworks-spring-boot-validation

Use when you need to design, review, or improve validation in Spring Boot applications — including Bean Validation on request DTOs, @Valid/@Validated at API boundaries, constraint groups, custom constraints, @ConfigurationProperties validation, nested DTO validation, and consistent validation error handling. This should trigger for requests such as Add validation support in Spring Boot; Review Spring Boot validation rules; Improve request validation in Spring Boot REST APIs; Add custom Bean Validation constraints in Spring Boot; Validate configuration properties in Spring Boot. Part of cursor-rules-java project

393 Updated today
jabrena
AI & Automation Solid

312-frameworks-spring-data-jdbc

Use when you need to use Spring Data JDBC with Java records — including entity design with records, repository pattern, immutable updates, aggregate relationships, custom queries, transaction management, and avoiding N+1 problems. This should trigger for requests such as Review Java code for Spring Data JDBC; Apply best practices for Spring Data JDBC in Java code. Part of cursor-rules-java project

393 Updated today
jabrena