Flyway is an open-source database migration tool and Snowflake is one of the database it supports. With the help of Flyway every time the need to evolve the database arises, whether structure (DDL) or reference data (DML), create new scripts with a version number higher than the current one, trigger the pipeline and the database upgrade completes automatically with the latest scripts.
Flyway Database Tool Setup
Navigate to Tools Registry
Select ‘+New Tool’ button
Locate the ‘Flyway Database’ tool and click ‘Select Tool’ button.
Provide values for required fields and any additional info and click ‘Create’ button.
With the new tool, navigate to the Connections tab to configure.
Provide proper credentials to required fields and any additional information, then click ‘Save’ button.
Once saved, click ‘Test Connection’ button to verify connection is successful.
If connection is successful as indicated by button and log, proceed to pipeline setup.
Pipeline Setup
Navigate to pipelines.
Select ‘+ New Pipeline’ button to create a new pipeline.
Select a template then proceed to Edit Workflow.
In initial Step Setup, set tool as ‘Flyway Database’. Save and click settings cog to reconfigure in Step Configuration:
Flyway Database: The database(Snowflake) account configured in the tool registry
SCM Type: Source Control tool → Bitbucket, Gitlab….
SCM Account: Source Control configured in the Tool Registry
Workspace/Project: Source control Workspace/Project that hosts the repository corresponding to the Snowflake Database.
Repository: Source control Repository that contains the scripts to be migrated
Branch: Source Control Branch that needs to be migrated
Schema: Schemas that will be managed by flyway
Base Schema: Schema that will host the flyway schema history table
Scripts Location: The location within SCM where the sql scripts are to be found
Database: The Snowflake database where this migration is bound to happen
Warehouse: The Snowflake Compute warehouse to be utilized for this operation