Skip to content

Replace ddl-auto=update with Flyway migrations #4

Description

@simonforsberg

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Avoid ddl-auto=update in default runtime config.

Automatic schema mutation in shared/prod-like environments is risky; default to validate and control schema changes via migrations.

🛠️ Suggested change
-spring.jpa.hibernate.ddl-auto=update
+spring.jpa.hibernate.ddl-auto=validate
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

spring.jpa.hibernate.ddl-auto=validate
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@messageService/src/main/resources/application.properties` at line 11, The
application is using spring.jpa.hibernate.ddl-auto=update which allows automatic
schema mutation at runtime; change the default value to
spring.jpa.hibernate.ddl-auto=validate (or remove the property) so the app
validates the schema instead of altering it, and ensure any schema changes are
applied through your migration tooling (e.g., Flyway/Liquibase) rather than via
the ORM.

Originally posted by @coderabbitai[bot] in #2 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions