Redgate Flyway

Tutorial - Create a new project


  1. Launch Flyway Desktop and sign in with your Redgate ID.
    1. A license will need to be assigned to your Redgate ID or you can start a free trial.
  2. Click New project... on the Flyway Desktop home screen to launch a modal.
  3. Enter a name for the new project.
  4. Specify the location on disk for the project files. It's best if you capture these changes in a dedicated area, maybe by creating a "Database" folder in your existing local repository folder or another folder on your local disk.  This way all database related scripts can be kept together.  Some teams like to structure the folders on disk to have a top level application name with subfolders for Application and Database files.  Example


    You can choose to add the Project name as a folder at the end of the location specified or not.
  5. Select the Database Type.  In this example, we use SQL Server.
  6. If you select a database that we have advanced comparison capabilities for, you'll also see a Deployment source option.  The default is Migrations.  The other option is Schema model, which means you'll use the state of each database object, captured as DDL in the schema model, to compare to a target database and generate a script for deployment.  You can learn more about these different approaches.  If you're not sure, use Schema model.  You can always switch to migrations later.  Once you are using migrations, you can not switch back.  You always deploy with one or the other.
  7. Click Create project.

The new project will then be opened. If you are using a database for which there are advanced comparison capabilities, you will land on the Schema Model page and be prompted for development environment credentials. Otherwise you will land on the Migrations page.

Create a folder in which to create your Flyway project:

  1. mkdir SqlServerProject
  2. cd SqlServerProject


Run the init command:

  1. flyway init -projectName=SqlServerProject -databaseType=sqlserver

Once run this will leave us with a project folder that looks as follows:

  1. C:\Users\Flyway\FlywayProjects\SqlServerProject> ls
  2.  
  3.  
  4. Directory: C:\Users\Flyway\FlywayProjects\SqlServerProject
  5.  
  6.  
  7. Mode LastWriteTime Length Name
  8. ---- ------------- ------ ----
  9. d----- 05/12/2024 14:48 migrations
  10. d----- 05/12/2024 14:48 schema-model
  11. -a---- 05/12/2024 14:48 69 .gitignore
  12. -a---- 05/12/2024 14:48 4711 Filter.scpf
  13. -a---- 05/12/2024 14:48 3711 flyway.toml
  14. -a---- 05/12/2024 14:48 0 flyway.user.toml

Next steps

Optionally save your new project to Version Control:

And then pick one of the following:


Didn't find what you were looking for?