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

Flyway 3.0 Migration Checksum mismatch

Flyway 3.0 changed the default of validateOnMigrate to true. This is however a good thing, as in the spirit of fail fast, errors are discovered sooner. In your case some scripts did change since they were applied, which is what Flyway is reporting. You have two options: suppress the error by setting validateOnMigrate to false … Read more

How to disable flyway in a particular Spring profile?

FYI, for anybody who comes here looking for this, the property name has changed for Spring Boot 2.0: For application.properties format: spring.flyway.enabled=false For application.yml format: spring: flyway: enabled: false Update: To disable flyway in a specific profile, you can put that property in the properties file specific to that profile. For instance, if your profile … Read more

Caused by: org.flywaydb.core.api.FlywayException: Validate failed. Migration Checksum mismatch for migration 2

Flyway is comparing the checksum of the SQL script with that of the previously run checksum. This exception typically occurs if you change a SQL script that has already been applied by Flyway, thus causing a checksum mismatch. If this is development, you can drop your database and start the migrations from scratch. If you’re … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)