State-based approach

EDITION: TEAMS EDITION: ENTERPRISE

State-based development and state-based deployment

The source of truth of the state of the development database is captured in the schema model on disk.  This represents a script for each object and any static data.  This schema model is used as the "desired state" for both the purposes of sharing changes within the team and as a source for deployment.

The deployment script is created at deployment time by Flyway's comparison engine and comparing the schema model to a target. Note: that there are complex changes that cannot be inferred by a comparison engine, such as adding new NOT NULL columns without a DEFAULT to tables that contain data, table or column renames, and other changes that require data to be moved or transformed.

The state-based deployment model is suitable for:

  1. Teams that are manually running their deployments (e.g., don't use an automated CI/CD pipeline).
  2. Teams using an automated CI/CD pipeline, but do not expect to make "complex" updates to their database that would require a manually-crafted migration script regularly.  Teams encountering increasingly complex changes should look at the Combined state and migrations approach.

Required Edition

Flyway CommunityFlyway TeamsFlyway Enterprise
Sharing changes in dedicated development databasesNot supportedChanges shared using schema modelChanges shared using schema model
Database CI/CD

Not supported

Not supported

Flyway checks available
Database DeploymentNot supportedManual state-based deployments allowedAutomated state-based deployments allowed

Learn how to implement the state-based deployments


Didn't find what you were looking for?