Search code examples
spring-bootdatabase-migrationflyway

Is it needed to stop Spring Boot application during Flyway migration?


I have Spring Boot application container deployed in k8s. And I have separate container with Flyway image. I need to make a migration in PostgreSQL DB. Do I need to stop the Spring Boot application container before the migration? Or the application will automatically catch the changes in the DB and fail in case of inappropriate DB schema?


Solution

  • In my special case behavior is the following:
    It is not needed to stop the Spring Boot pod to make a migration. In case of wrong schema - requests will return 500 error and the pod will not restart. And when the schema will be fixed, the application will start to work properly without any additional restarts.

    PS: pay attention on the question's comments