Domanda

Based on my understanding about flyway/liquibase, they provide ways to perform database upgrades through the pre configured scripts (SQL queries, Java files, etc.,). But i am not very much clear about the following :

  1. What happens if there is destructive upgrade.

    I have a use case like changing an bigint column(containing data) to date type. If i try to change it directly, i will end up with corrupted data for the column. How does flyway/liquibase handle these kinds of upgrades ?

  2. Whether pre configured scripts are the only way to say flyway/liquibase that these are my changes or is there any other way for that matter. If there is some other way, will it output the diff in the form of queries ?

It will be very much helpful if someone shed light on the above.

È stato utile?

Soluzione

Speaking from Flyway's perspective, it was built with sql and java support from the start. How you migrate your db using either of these is your responsibility. Flyway will do as you tell it.

Altri suggerimenti

In Liquibase you can make this work by using the SQL Formated scripts, I assume your trying to make use of the XML markup tags to avoid having to do raw SQL and running into the down fall of having the XML translate exactly what you want to do. Make life easier and use SQL scripts and leverage Liquibase.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top