Use when modifying database entities or schema. Ensures schema.sql and data.sql remain consistent with Entity changes. Keywords: Entity, schema.sql, data.sql, database change, synchronization.
Ensures that any changes to database entities, data models (DTO/VO), or business logic table structures are immediately synchronized across schema.sql and data.sql to maintain a consistent environment.
Whenever you modify Java Entities, alter table structures, or introduce new relationships (like many-to-many).
src/main/resources/schema.sql to reflect the latest field changes, new table definitions, or constraint conditions (e.g., CREATE TABLE rules).src/main/resources/data.sql to ensure INSERT statements remain compatible with the modified table structure.
INSERT operations.ON DUPLICATE KEY UPDATE or similar idempotent SQL strategies where possible, ensuring data.sql can run multiple times without causing duplicate ID conflicts.schema.sql, but forgetting to update data.sql, causing the Spring Boot application to crash on startup due to missing column assignments.schema.sql, update initial insert data in data.sql, and execute a compilation check (mvnw clean compile).