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 Toggle source code

  1. {
  2. "version": "1.1",
  3. "postFilters":
  4. [
  5. {
  6. "filterBy": "objectType",
  7. "filterValue": "view",
  8. "effect": "exclude"
  9. }
  10. ]
  11. }

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

  1. {
  2. "version": "1.1",
  3. "postFilters":
  4. [
  5. {
  6. "filterTarget": "property",
  7. "filterBy": "name",
  8. "filterValue": "collation",
  9. "effect": "exclude"
  10. }
  11. ]
  12. }

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

  1. {
  2. "version": "1.1",
  3. "postFilters":
  4. [
  5. {
  6. "filterBy": "objectType",
  7. "filterValue": "view",
  8. "effect": "exclude"
  9. },
  10. {
  11. "filterTarget": "property",
  12. "filterBy": "name",
  13. "filterValue": "collation",
  14. "effect": "exclude"
  15. }
  16. ]
  17. }

PostgreSQL specific example scenarios

These examples apply only to PostgreSQL and its variants

How do I ignore all privileges Toggle source code

  1. {
  2. "version": "1.1",
  3. "postFilters":
  4. [
  5. {
  6. "filterTarget": "property",
  7. "filterBy": "name",
  8. "filterValue": "privileges",
  9. "effect": "exclude"
  10. }
  11. ]
  12. }

How do I ignore all owners Toggle source code

  1. {
  2. "version": "1.1",
  3. "postFilters":
  4. [
  5. {
  6. "filterTarget": "property",
  7. "filterBy": "name",
  8. "filterValue": "owner",
  9. "effect": "exclude"
  10. }
  11. ]
  12. }




Didn't find what you were looking for?