CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

testland/flyway-migrations

Use whenever a schema is managed with Flyway: versioned, repeatable and undo migration files, migrate, info, validate, baseline and repair, the schema history table, migration ordering questions, and CI gates on schema changes, via CLI, Maven, Gradle or Docker.

Quality

91%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

Overview
Quality
Evals
Security
Files

commands.mdreferences/

Flyway command reference and CI integration

Command reference

Per fw-home, Flyway's commands are Migrate, Clean, Info, Validate, Undo, Baseline, Repair, Check, and Snapshot.

CommandUse
flyway migrateApply pending migrations
flyway infoShow applied + pending migration list
flyway validateVerify checksums of applied migrations vs disk files
flyway baselineMark a legacy schema state as baseline (skip prior migrations)
flyway repairFix a broken flyway_schema_history (e.g., after a failed migration)
flyway undoRoll back the last versioned migration (Teams)
flyway cleanDrop all objects in the schema (production-disabled by default)

CI integration

Pattern: ephemeral DB (Docker / Testcontainers) per PR, apply migrations, run tests against the migrated schema.

- name: Spin up Postgres
  uses: docker/setup-buildx-action@v3
- run: docker run -d --name pg -p 5432:5432 -e POSTGRES_PASSWORD="$FLYWAY_PASSWORD" postgres:16
  env:
    FLYWAY_PASSWORD: ${{ secrets.CI_DB_PASSWORD }}
- name: Apply migrations
  env:
    FLYWAY_PASSWORD: ${{ secrets.CI_DB_PASSWORD }}
  run: |
    docker run --rm --network=host -e FLYWAY_PASSWORD \
      -v "$PWD/db/migration:/flyway/sql" \
      flyway/flyway -url=jdbc:postgresql://localhost:5432/postgres \
      -user=postgres migrate
- name: Run tests
  run: mvn test

Both steps read the password from the CI_DB_PASSWORD repository secret, so no literal value lands in the workflow file.

For full integration with testcontainers (in the qa-test-environment plugin): spin up the DB via Testcontainers, then call Flyway.configure() in JUnit @BeforeAll.

references

SKILL.md

tile.json