Back to Flyway

Commands

documentation/Reference/Commands.md

latest6.0 KB
Original Source

Flyway provides a comprehensive set of commands to manage database migrations and schema evolution.

Project Setup & Management

Commands for initializing and setting up Flyway projects

CommandTierDescription
InitCommunityInitializes a new Flyway project with default configuration and folder structure
AuthTeamsInitiates license acquisition flow for Flyway Teams and Enterprise editions

Migration Management

Core commands for applying and managing database migrations

CommandTierDescription
AddCommunityCreates new empty migration scripts following your project's naming conventions
InfoCommunityShows detailed status about the target and information about all migrations, including what's been applied and what's pending
ValidateCommunityChecks for differences between the available migrations and the migrations applied to the target
RepairCommunityRepairs the schema history table by removing failed migrations and realigning checksums
BaselineCommunityBaselines an existing database by marking it as migrated up to a specific version

Database Development & Comparison

Commands for developing and comparing databases

CommandTierDescription
Check ChangesEnterpriseAnalyzes changes between migrations and the database
Check CodeCommunityPerforms code analysis on migrations
DiffEnterpriseCompares a source with a target to identify differences
Diff TextEnterpriseOutputs the object definitions from a differences artifact generated by the diff command
GenerateEnterpriseGenerates migration scripts automatically based on schema differences from diff operations
ModelEnterpriseCreates or updates a schema model

Deployment

Commands for deploying changes to a database

CommandTierDescription
MigrateCommunityExecutes pending migrations against target environment
UndoTeamsRolls back the most recently applied versioned migration
Check DriftEnterpriseDetects schema drift between the database and migrations
Check DryRunTeamsPerforms a dry run of migrations to preview changes
PrepareEnterpriseGenerates a deployment script from a comparison source
DeployEnterpriseExecutes deployment scripts against target databases
SnapshotEnterpriseTakes snapshots of database state for comparison

Utilities

CommandTierDescription
List EnginesCommunityLists all available database engines and their versions
CleanCommunityDevelopment only - Drops all objects in configured schemas - never use on production!