User Story: Improve Flyway skills for all frameworks
As a maintainer
I want to add more Flyway capabilities to the framework-specific skills
So that users receive better guidance that helps mitigate potential issues when adding database migration files with Flyway
Acceptance Criteria
Feature: Apply good criteria when add Migration DB files using Flyway
@acceptance-test
Scenario: Provide guidance for adding Flyway migration files
Given a problem to be resolved with Flyway
When the skill provides guidance for implementing new migration files
Then the guidance includes good advice for adding Flyway migration files
And the advice helps mitigate potential Flyway migration issues
Description
Existing context to preserve:
Implementation Ideas
Add two new reference sections/examples to each Flyway skill:
313-frameworks-spring-db-migrations-flyway
413-frameworks-quarkus-db-migrations-flyway
513-frameworks-micronaut-db-migrations-flyway
Flyway Antipatterns Reference
Include guidance for reviewing migration files that may accidentally damage data or production availability:
- Avoid drop-and-add column changes when the intent is a rename; prefer an explicit rename or an expand/migrate/contract sequence.
- Avoid narrowing column types or reducing column lengths without checking existing production-like data.
- Avoid adding
NOT NULL columns with defaults that invent incorrect business meaning for historical rows.
- Avoid changing default values without checking future-row behavior and application assumptions.
- Avoid dropping and recreating tables, join tables, constraints, or indexes when preserving existing relationship data matters.
- Avoid changing enum/status meanings without a compatibility plan for existing rows and application code.
- Avoid timestamp/timezone type changes without verifying interpretation of existing values.
- Avoid destructive repeatable migrations, especially
DELETE plus INSERT patterns that rerun when checksums change.
- Avoid broad data updates without precise
WHERE clauses and row-count expectations.
- Avoid unique/index changes without checking duplicates and cleanup strategy first.
- Include Flyway tests to avoid out-of-order migrations in different branches, duplicate version numbers, and migrations that assume another branch migration already ran.
- Treat
outOfOrder=true as an exceptional operational choice, not a default fix for branch conflicts.
Flyway Techniques Reference
Explain Martin Fowler's Parallel Change technique as a database migration strategy:
- Expand: add the new column/table/index/constraint in a backward-compatible way while the old shape still works.
- Migrate: backfill or dual-write data, update reads safely, and verify both old and new paths during rollout.
- Contract: remove the old column/table/path only after all deployed code and data have moved to the new shape.
Apply the technique to Flyway examples such as column rename, type changes, large-table backfills, and relationship-table changes. Prefer multiple small forward-only migrations over one destructive migration.
Testing Ideas
Add test guidance that goes beyond checking application startup:
- Run the full Flyway chain from an empty database using the real production dialect when feasible.
- Run migration tests from a previous-release schema/data snapshot for risky changes.
- Assert data preservation for renames, backfills, defaults, enum/status changes, and timezone changes.
- Add branch-ordering checks in CI to detect duplicate versions and unsafe out-of-order assumptions.
- Prefer Testcontainers or framework-native real-database test support over H2 when production uses PostgreSQL, MySQL, or another specific dialect.
Notes
- Scope applies to Flyway skills for all supported frameworks.
- Existing context references Flyway migration tests and avoiding out-of-order migrations across different branches.
- Existing context references Martin Fowler's Parallel Change article as supporting context.
INVEST Validation
- Independent: PASS - The story can be delivered by improving Flyway skill guidance without requiring unrelated skill changes.
- Negotiable: PASS - The exact examples and wording can be refined while preserving the intent to improve Flyway migration guidance.
- Valuable: PASS - Maintainers and users gain clearer advice that reduces migration mistakes.
- Estimable: PASS - The scope is bounded to adding Flyway capabilities and examples across framework skills.
- Small: PASS - The work can be split by framework-specific Flyway skill updates.
- Testable: PASS - Completion can be checked by reviewing generated skill output and validating that guidance covers Flyway migration-file advice and issue mitigation.
User Story: Improve Flyway skills for all frameworks
As a maintainer
I want to add more Flyway capabilities to the framework-specific skills
So that users receive better guidance that helps mitigate potential issues when adding database migration files with Flyway
Acceptance Criteria
Description
Existing context to preserve:
Implementation Ideas
Add two new reference sections/examples to each Flyway skill:
313-frameworks-spring-db-migrations-flyway413-frameworks-quarkus-db-migrations-flyway513-frameworks-micronaut-db-migrations-flywayFlyway Antipatterns Reference
Include guidance for reviewing migration files that may accidentally damage data or production availability:
NOT NULLcolumns with defaults that invent incorrect business meaning for historical rows.DELETEplusINSERTpatterns that rerun when checksums change.WHEREclauses and row-count expectations.outOfOrder=trueas an exceptional operational choice, not a default fix for branch conflicts.Flyway Techniques Reference
Explain Martin Fowler's Parallel Change technique as a database migration strategy:
Apply the technique to Flyway examples such as column rename, type changes, large-table backfills, and relationship-table changes. Prefer multiple small forward-only migrations over one destructive migration.
Testing Ideas
Add test guidance that goes beyond checking application startup:
Notes
INVEST Validation