79723454

Date: 2025-08-02 15:16:01
Score: 0.5
Natty:
Report link

IMHO setting the requireForce via environment variable does not make sense.
I want to have it active ALWAYS.
So that the application will never drop my database unless I actively set force=true.

As Spring Boot unfortunately does not support the requireForce parameter, I set it like so:

@SpringBootApplication
public class MyApplication {
  public static void main(String[] args) {
    System.setProperty("liquibase.command.dropAll.requireForce", "true");
    SpringApplication.run(MyApplication.class, args);
  }
}

Then in my run configuration for my dev environment I can add -Dliquibase.command.dropAll.force=true.

This way, when I have spring.liquibase.drop-first=true in my properties in my production environment, my application startup will ALWAYS fail instead of dropping my production database.

Reasons:
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: aminator