Combined state and migrations approach
Published 08 August 2022
Combined approach - State-based development, migrations-based deployment
The source of truth for the development database is the schema model, which is used as the "desired state" for the purpose of sharing changes with other developers.
Migration scripts are the source of truth for deployments.
This decouples the sharing of changes within a team from the deployment process. This could help reduce the number of migration scripts and means that the ordering doesn't have to align with when the changes were made in development.
This model is recommended for Flyway Teams and Flyway Enterprise users who want full control over their deployments in their CI/CD pipelines.
Edition Required | Flyway Community | Flyway Teams | Flyway Enterprise |
---|---|---|---|
Authoring migrations | Not supported | Self-author migration scripts | Generate migration scripts Auto-generate migration scripts |
Sharing changes in development | Not supported | Developers update their development database from the version controlled schema model* | Developers update their development database from the version controlled schema model* |
Database CI/CD | Not supported | Basic code analysis checks Dry run script generated for pre-deployment review/approval | + Custom SQL code analysis reports + Flyway checks - changes report, drift report, and |
Database Deployment | Not supported | Apply migration scripts | + integrate with secrets managers, Redgate Monitor + Integrate with Redgate Test Data Manager (Preview) and unlimited data retention in Flyway Pipelines (Preview) |
* Complex changes, for example those that require data motion (and therefore can't be inferred from the schema model), must be applied to dedicated development environments manually.