Failure when using different types of Clients (Desktop and API)

ms7ms7 Posts: 2 New member
edited December 31, 2023 11:37AM in PostgreSQL
We're testing out Flyway for our company's system, and it seems that if we run our first migration file from the code (Java (kotlin) api), then we're unable run the next one using the Flyway Desktop app.

If we use the Repair option in the Desktop app, then the migration works.
But then the migrations using the api get messed up and fail (and crash our server when launched)

Is it possible to use migrations with multiple types of client?
If so, what is the recommended way to do so?

Answers

  • Hello ms7,

    Thank you for the question, yes what you're attempting is completely possible.
    The scripts you're running, were they authored by Redgate tools or are of your own making please? Either is fine, it simply alters my considerations.

    Are you able to see what the repair action alters? If you need to recreate it, a before and after migration output of the schema history table should suffice.

    Once cavitate I would offer is the two Flyway engines (API & CLI) should be of roughly comparable versions, otherwise you could get mismatches behaviour.
    Kind regards
    Peter Laws | Redgate Software
    Have you visited our Help Center?
  • ms7ms7 Posts: 2 New member
    Hi Peter,
    Yes I use scripts of our own making.
    And I also make sure the migrations version number is always correct and incremented by 1.
    I'm not sure regarding the repair. I am able to migrate using the Desktop despite the fact that it fails the "Validate".
    But then the problems start with the migrations by code java API (using the files inside the db/resources/ folder)
  • Are you able to write the flyway output to file from the API, so we can see what's going wrong when it fails please?
    Kind regards
    Peter Laws | Redgate Software
    Have you visited our Help Center?
  • miley88miley88 Posts: 1 New member
    Experiencing failures while using different client types like desktop and API can stem from compatibility issues or misaligned protocols. Ensure seamless communication by standardizing data formats and verifying API endpoints. Consistent testing and clear documentation can bridge the gap between diverse client types for smoother interactions.
  • jhonndeejhonndee Posts: 1 New member
    It sounds like you're running into conflicts between Flyway migrations managed via the API and those handled by the Desktop app. You can use multiple clients, but it's crucial to ensure that they are synchronized to avoid conflicts. The recommended approach is to choose one method for managing migrations and stick with it to prevent discrepancies. If you need to use both methods, make sure to use Flyway's repair and clean commands carefully to maintain consistency. It might also help to review Flyway's documentation on managing migrations across different clients for additional guidance.

Leave a Comment

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