Flyway Overview

Flyway is a version control tool for database versioning

Cheatsheet:

Command
What it does

migrate

Migrates the database

clean

Drops all objects in the configured schemas

info

Prints the details and status information about all the migrations

validate

Validates the applied migrations against the ones available on the classpath

undo

Undoes the most recently applied versioned migrations

baseline

Baselines an existing database, excluding all migrations up to and including baselineVersion

repair

Repairs the schema history table

For Debug use flax -x

  • a prefix: which defaults to V

  • a version: dots or underscores separated in as many parts as one likes

  • separator: which defaults to __ (two underscores) and separates the version from the description

  • description: a text with words separated by underscores or spaces

  • suffix: which defaults to .sql

In Flyway home

  • Initial script called flyway which accepts parameters

  • conf folder where you can find the configs for different schemas Example:

  • Home file structure:

Script for case migration for different schemas:

Last updated