Skip to content

Commit

Permalink
[fix] #16 필요없는 부분 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
kmjenny committed Feb 17, 2024
1 parent b71323c commit d996fdf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/harang/server/domain/Location.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class Location {
@Column(name = "id", nullable = false)
private Long id;

@OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@JoinColumn(name = "post_id")
private Post post;

Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/harang/server/service/PostService.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public Post createPost(Long memberId, PostRequest request) {
@Transactional
public void deletePost(Long memberId, Long postId) {
Post post = postRepository.findByIdOrThrow(postId);
Location location = locationRepository.findByPostId(postId);

locationRepository.deleteByPostId(postId);
postRepository.delete(post);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://${DB_HOST}:${DB_PORT}/${DB_NAME}?useSSL=false&serverTimezone=Asia/Seoul&characterEncoding=UTF-8
url: jdbc:mysql://${DB_HOST}:${DB_PORT}/${DB_NAME}?useSSL=false&serverTimezone=Asia/Seoul&characterEncoding=UTF-8&allowPublicKeyRetrieval=true
username: ${DB_USER}
password: ${DB_PASSWORD}

Expand Down

0 comments on commit d996fdf

Please sign in to comment.