Skip to content

SH303: Hibernate changes the database schema at startup

Severity: medium · Category: configuration · Applies to: spring

Why it matters

ddl-auto set to create, create-drop or update lets the application drop or alter tables on startup, which can destroy production data.

How to fix

Set spring.jpa.hibernate.ddl-auto to validate or none and manage the schema with Flyway or Liquibase.

Ignoring this rule

Skip it everywhere in devshield.yml:

ignore:
  - SH303

Or skip one line with a comment on that line or the line above:

devshield-ignore: SH303