Redgate Flyway

Tutorial - Write your own migration scripts 

You can also add your own migration scripts in the project folder.  Make sure you are following your project's naming convention (V###__<description>.sql,  R__<description>.sql, or U###<description>.sql).  This can be useful for migration scripts that deal with updating transactional data or for scripts that are supplied to you by someone else.  

After opening a project, use the folder icon in the top right to jump to your project on disk:


You can also add new migration scripts on the Migrations tab:
→ 

You can optionally use the flyway add command to generate an empty migration with an incremented version:

  1. flyway add

For example if two migration locations exist with the following contents:

  1. $ ls legacy-migrations
  2. B1.0.0__Baseline.sql
  3. ...
  4. V1.0.25__Migration.sql
  5.  
  6. $ ls migrations
  7. V2.0.1__Migration.sql
  8. ...
  9. V2.0.54__Migration.sql

Then Flyway would calculate the next migration version to be 2.0.55 .

You can then write the SQL you need in the file.



Didn't find what you were looking for?