Redgate Flyway

Tutorial - Update PostgreSQL and MySQL filters

You can setup filters to include/exclude objects within each project. 

  1. In Flyway Desktop, on the Schema model page within a project, click on Configure comparison.



  2. Click the Filters tab and then Add Rule:
  3. Select the object from the drop down and setup the rule.  You can add additional conditions or add another rule for a different object type.  Then click Save.


In addition to filtering objects in/out of the comparison, the filter file can be manually edited to also filter properties.   

Example scenarios

I want to ignore all properties of a particular name e.g. collations

{
    "version": "1.1",
    "postFilters":
    [
        {
            "filterTarget": "property",
            "filterBy": "name",
            "filterValue": "collation",
            "effect": "exclude"
        }
    ]
}

PostgreSQL specific example scenarios

These examples apply only to PostgreSQL and its variants

How do I ignore all privileges

{
    "version": "1.1",
    "postFilters":
    [
        {
            "filterTarget": "property",
            "filterBy": "name",
            "filterValue": "privileges",
            "effect": "exclude"
        }
    ]
}

How do I ignore all owners

{
    "version": "1.1",
    "postFilters":
    [
        {
            "filterTarget": "property",
            "filterBy": "name",
            "filterValue": "owner",
            "effect": "exclude"
        }
    ]
}

How do I ignore partitions of a certain partition method/strategy

{
    "version": "1.0",
    "postFilters":
    [
        {
            "filterTarget": "objectType",
            "filterBy": "propertyValue",
            "filterProperty": "partitionInfo.partitionStrategy",
            "filterValue": "HASH",
            "effect": "exclude"
        }
    ]
}

RANGE partitions are ignored by default, how do I include them?

{
    "version": "1.2",
    "postFilters":
    [
        {
            "filterTarget": "objectType",
            "filterBy": "propertyValue",
            "filterProperty": "partitionInfo.partitionStrategy",
            "filterValue": "RANGE",
            "effect": "include"
        }
    ]
}

See also

TABLESPACE support can also be enabled using a filter file.



Didn't find what you were looking for?