Redgate Flyway

For PostgreSQL users - where are your DBs hosted?

Comparison filtering

You can configure include and exclude rules for objects when generating the list of differences that can 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 or being used in automatically generated scripts.

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

Filters are supported for all database types for which there is comparison engine support.

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.

Flyway Desktop does not currently offer a way to configure filters from the UI, although it does offer to exclude invalid objects during the baseline script generation process. For SQL Server it is possible to use SQL Compare to generate the filter file - see here for how to do this. For Oracle you can similarly generate a file using Schema Compare for Oracle. Otherwise the files must be updated manually.

Filters and dependencies

For SQL Server and Oracle, when updating a schema model, updating a database, or generating a migration or other deployment script based upon a database comparison, Flyway will automatically look to pull in non-identical objects which your selected objects depend on.

This helps avoid generating scripts which won't deploy, However, it may pull in objects which would otherwise be filtered out.

Ignore Rules

Ignore rules provide the same capability as filters, except that 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, depending upon how many objects are excluded.

Ignore rules are only supported for Oracle databases. They will almost always be preferable to filters when using Oracle.


Didn't find what you were looking for?