Redgate Flyway

Tutorial - Update PostgreSQL and MySQL filters

Currently, there is no GUI in Flyway Desktop to customize the filter files.

The filter file has to be manually created in one of two ways:

  • create a file called filter.rgf in the project folder (next to flyway.toml)
  • specify a particular file name in flyway.toml (under redgateCompare.filterFile) and create that file instead

Example scenarios

These examples apply to all supported database engines i.e. PostgreSQL and MySQL

I want to ignore all objects of a particular type e.g. views

{
    "version": "1.1",
    "postFilters":
    [
        {
            "filterBy": "objectType",
            "filterValue": "view",
            "effect": "exclude"
        }
    ]
}

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"
        }
    ]
}

How do I ignore multiple property names and object types e.g. collations and all views

{
    "version": "1.1",
    "postFilters":
    [
        {
            "filterBy": "objectType",
            "filterValue": "view",
            "effect": "exclude"
        },
        {
            "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 (currently an active filter)

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





Didn't find what you were looking for?