Can Flyway Desktop avoid comparing objects inside schemas that I haven't specified?

anthonymanthonym Posts: 3 New member
edited September 5, 2024 4:38PM in PostgreSQL
Scenario:
* I'm using Flyway Desktop 7.6.0, in either "Schema model" or "Migrations" mode
* There is one Postgres DB function in our "insights" schema that uses a SQL BODY instead of PL/pgSQL.
* I've specified a bunch of DB schemas for the project, excluding that one schema: "insights"
* The DB comparison step fails with this error: "Error registering comparison sources -- The function my_sql_body_function() was declared using the sql_body form, which is not yet supported."

Question: Is there a way to tell Flyway Desktop to ignore that sql_body function in the "insights" schema, and only compare objects in the schemas that I've specified?

Answers

  • Hi Anthony,

    Apologies for the issues you’re experiencing with Flyway Desktop.

    Could you please:

    1. Share a copy of the Flyway Desktop logs?
    2. Let me know if you’re already using a filter file to focus on the schemas relevant to your project?

    If you’re not already using a filter, you’ll need to create one to define which objects Flyway should compare. You can create a filter file by following the steps outlined in the documentation for PostgreSQL filtering: PostgreSQL and MySQL Filtering Documentation.

    Once you’ve set up the filter:

    • Add it to the flyway project directory and rerun. 

    If the issue persists after applying the filter, please send over both the Log and TOML file, and we can investigate further.


    Best, 

    Hassan 

    Product Support Engineer

  • anthonymanthonym Posts: 3 New member
    Thank you Hassan, I will try creating a filter file.

    Follow-up question: What does the "Schemas" list actually do in the "Connect to a target database" dialog? Does it not filter the schemas that are compared by the project?


  • anthonymanthonym Posts: 3 New member
    Follow-up question #2: What is the filter file format to exclude an entire schema of objects? The documentation isn't clear on how to do that.

    I would like to exclude our entire "insights" schema, something like this:
    {
        "version": "1.1",
        "postFilters":
        [
            {
                "filterTarget": "schema",
                "filterBy": "name",
                "filterValue": "insights",
                "effect": "exclude"
            }
        ]
    }
  • hassan_imamhassan_imam Posts: 45 Bronze 1
    edited September 20, 2024 3:18PM
    Hi Anthony,
    Apologies for the delay, excluding entire schemas from comparison in PostgreSQL with Flyway isn't directly supported via a filter targeting the "schema" level. While you can use filters to exclude specific object types (like tables or functions) or certain properties (like owners or privileges), excluding an entire schema itself isn’t an option currently provided in the standard filtering capabilities of Flyway Desktop for PostgreSQL:


    Best,
    Hassan
    Product Support Engineer

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file