Liquibase or Flyway database migration alternative for Elasticsearch

From this point of view/need, ES have a huge limitations: despite having dynamic mapping, ES is not schemaless but schema-intensive. Mappings cant be changed in case when this change conflicting with existing documents (practically, if any of documents have not-null field which new mapping affects, this will result in exception) documents in ES is immutable: … Read more

Embedded Postgres for Spring Boot Tests

I’m the author of the embedded-database-spring-test library that was mentioned by @MartinVolejnik. I think the library should meet all your needs (PostgreSQL + Spring Boot + Flyway + integration testing). I’m really sorry that you’re having some troubles, so I’ve created a simple demo app that demonstrates the use of the library together with Spring … Read more

Any way to “compress” Flyway migrations?

Isn’t that what re-baselining would do? I’m still new to flyway, but this is how I think it would work. Please test the following first before taking my word for it. Delete the schema_version table. Delete your migration scripts. Run flyway baseline (this recreates the schema_version table and adds a baseline record as version 1) … Read more

What is Flyway baseline feature good for? [closed]

Baselining a database at version V1_0__baseline.sql, for example, instructs Flyway to only apply migration scripts that have been created after V1_0. It does this by inserting a migration entry in the SCHEMA_VERSION table used by Flyway. When you run a migration, available migration scripts will only be applied if their version is higher than the … Read more

Java code changeset in liquibase

Yes, there is such feature. You can create a customChange: <customChange class=”my.java.Class”> <param name=”id” value=”2″ /> </customChange> The class must implements the liquibase.change.custom.CustomTaskChange interface. @Override public void execute(final Database arg0) throws CustomChangeException { JdbcConnection dbConn = (JdbcConnection) arg0.getConnection(); try { … do funny stuff … } catch (Exception e) { // swallow the exception ! … Read more

How to roll back migrations using Flyway?

While Flyway supports rollbacks (as a commercial-only feature) its use is discouraged: https://flywaydb.org/documentation/command/undo While the idea of undo migrations is nice, unfortunately it sometimes breaks down in practice. As soon as you have destructive changes (drop, delete, truncate, …), you start getting into trouble. And even if you don’t, you end up creating home-made alternatives … Read more