Redgate Flyway

Comparison filtering

You can configure include and exclude rules when generating a list of object differences that will be included in the schema model and migration scripts.

See Updating configurations for instructions on how to update all filter settings.

Filters

Filters suppress database objects from appearing in comparison results and from being included in generated migration scripts.

This suppression occurs after a comparison has run so it does not deliver a performance improvement.

Filters are supported for SQL Server, Oracle, PostgreSQL and their cloud database variants.  

Common use cases for filters include:

  • Filtering out object types you may not want to track in source control, such as users
  • Filtering out environment-specific objects. For example there may be objects in your production environment which do not exist in your development environment. You do not want these objects to be surfaced as drift and you would want to ensure that they were left alone if deploying from the schema model.
  • Filtering out test objects
  • Filtering out invalid objects in order to generate a valid baseline script

By default, Flyway filters out users and objects that that contain secure information, such as SQL Server certificates.

The exact format of the filter files varies by database type. See the reference docs for more details.

Filters and dependencies

For SQL Server and Oracle, when saving to the schema model, updating your development database, preparing a deployment script, or generating a migration script, Flyway pulls in objects which your selected objects depend on even if that object is excluded by the filter.  This avoids generating scripts which won't deploy due to missing dependencies. 

Ignore Rules - Oracle databases only

Ignore rules provide the same capability as filters, except the objects are excluded before the database comparison takes place.

This means that in addition to the standard benefits of filtering, there may be a substantial performance benefit as well depending upon what objects are excluded.

Ignore rules are only supported for Oracle databases. They are usually preferable to filters for the performance improvement.


Didn't find what you were looking for?