Spring framework application config와 관련된 에러이다.
org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "alter table team drop foreign key FKdyddawruqdwvuy3n6kgmc4q4j" via JDBC Statement
at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) ~[hibernate-core-6.1.7.Final.jar:6.1.7.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.applySqlString(SchemaDropperImpl.java:419) ~[hibernate-core-6.1.7.Final.jar:6.1.7.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.applySqlStrings(SchemaDropperImpl.java:403) ~[hibernate-core-6.1.7.Final.jar:6.1.7.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.applyConstraintDropping(SchemaDropperImpl.java:373) ~[hibernate-core-6.1.7.Final.jar:6.1.7.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.dropFromMetadata(SchemaDropperImpl.java:256) ~[hibernate-core-6.1.7.Final.jar:6.1.7.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.performDrop(SchemaDropperImpl.java:178) ~[hibernate-core-6.1.7.Final.jar:6.1.7.Final]
spring:
datasource:
url: jdbc:tc:mysql:///javatest
driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver #tc 사용드라이버를 jdbc로 설정
jpa:
hibernate:
ddl-auto: create-drop #테스트 시에는 create_drop으로 쓴다
generate-ddl: true
spring.jpa.hibernate.ddl-auto를 create-drop으로 두어서 나는 오류인데
테이블이 없다보니 drop할 것이 없어서 에러가 난다.
update로 변경하면 바로 해결
'ETC' 카테고리의 다른 글
[Error] Junit5 - Suspicious combination of '@Test' and '@ParameterizedTest' (0) | 2023.06.07 |
---|---|
[Error] Spring - spring.jpa.open-in-view is enabled by default (0) | 2023.05.25 |
[Error] Test - @Slf4j cannot find symbol 에러 (0) | 2023.05.23 |
[Error] JPA - @CreatedDate, @LastUpdatedDate가 null일때 (0) | 2023.05.23 |
[Error] Mysql Workbench 접속 에러 (0) | 2023.05.23 |
[Error] Spring boot - HikariPool-1 - Shutdown completed. Process finished with exit code 0 (0) | 2023.05.23 |
[IntelliJ] 인텔리제이 JUnit5 테스트 시, displayName이 안 나올 때 (0) | 2023.05.19 |
[Error] Gradle, Spring Boot 3.x.x 실행 에러 (0) | 2023.05.19 |