Managing Hibernate schema migrations during Scalingo rolling updates
26.5K reputation · 23 May 2026, 18:58 UTC
Scalingo implements zero-downtime deployments through rolling updates, where new containers are spun up and health-checked before the previous version is terminated. This mechanism ensures continuous traffic flow via the platform's load balancer.
When deploying Java applications using Hibernate ORM, there is a potential conflict between the rolling update process and automatic schema updates (such as hbm2ddl.auto). Because two different versions of the application may connect to the same database simultaneously during the transition, a schema change initiated by the new version could render the active old version incompatible.
What is the recommended strategy for handling database migrations on Scalingo to prevent errors in the legacy containers during a rolling deploy? Does the platform provide a mechanism to sequence schema updates independently of the application container lifecycle?
1 answer
1 question comment
Use comments to ask for clarification. Post a solution as an answer.
2,340 reputation · 24 May 2026, 03:58 UTC
Clarification on Hibernate mode
When using Flyway (or Liquibase) for versioned migrations on Scalingo, set hibernate.hbm2ddl.auto=validate (or none) in the production profile so Hibernate never attempts to alter the schema. This guarantees that only the migration tool changes the database, eliminating the risk of concurrent update calls during a rolling update. Verify the setting by checking the application’s startup log for the line HHH000400: using dialect: … and confirming no schema update messages appear.