Options

Manually editing baseline file

I have run into an issue where Flyway, when creating a baseline for an existing database, does not do a test for existence of database users; it simply writes a CREATE USER statement, which then fails during the comparison because the user already exists.

What I'd like to do is open the baseline file from the Git repo and simply add a test for existence of database users to that script. I am wondering if doing this will have unintended consequences on Flyway version tracking?
~JR~

Best Answer

  • Options
    JR_AUSJR_AUS Posts: 17 Bronze 2
    JR_AUS said:
    I have run into an issue where Flyway, when creating a baseline for an existing database, does not do a test for existence of database users; it simply writes a CREATE USER statement, which then fails during the comparison because the user already exists.

    What I'd like to do is open the baseline file from the Git repo and simply add a test for existence of database users to that script. I am wondering if doing this will have unintended consequences on Flyway version tracking?
    I created a ticket with Redgate and the solution is to modify the baseline file so that it includes the required test for existence, then commit changes. Having done this and re-run Flyway there are no negative impacts.
    ~JR~

Leave a Comment

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