1
votes

We have an existing database with several tables and every time we make any changes to the schema of some table we had to run some manual scripts to avoid any data loss. we are looking for software that can integrate with our Git repo and generate the updated DDL's for the database.

I came across Flyway database migration tool and going through the documentation had this question about integration with code repo where changes to database schema are pushed.

Also Does FLyway work with Snowflake. if yes, where can i add the required jdbc drivers to connect to the database and what would be the .conf file for Snowflake connection.

3

3 Answers

1
votes

Officially Flyway does not work with Snowflake at the moment (as you can see there https://github.com/flyway/flyway/pull/2274). According to this discussion there seems to be a Snowflake-compatible fork existing, however I wouldn't recommend going for that on a production system without heavily checking it, but if you really need it may be worth taking a look.

Regarding Flyway integration with Git, you can integrate Flyway in your CI process, by pulling the Flyway Docker image (https://github.com/flyway/flyway-docker) - or using your own image if you decide to go for a Snowflake-compatible fork - and running the migrate command against your target database(s).

1
votes

Just for the record, this has apparently changed.

Now, Snowflake is supported

https://flywaydb.org/documentation/database/snowflake

Although the current version (flyway 6.2.0) throws a warning...

WARNING: Flyway upgrade recommended: Snowflake 4.2 is newer than this version of Flyway and support has not been tested.

0
votes

I use flyway 6.4.2 and is working with this configuration in pom file:

<execution>
    <id>my_sf_migration</id>
    <phase>compile</phase>
    <goals>
        <goal>migrate</goal>
    </goals>
    <configuration>
        <!--This is where I got the driver wrong, that is why it was not working -->
        <driver>net.snowflake.client.jdbc.SnowflakeDriver</driver>
        <configFiles>
            <configFile>./conf/flyway_sf.conf</configFile>
        </configFiles>
    </configuration>
</execution>