Skip to content

Commit

Permalink
#82 feat : soft Delete 를 위한 isDeleted 컬럼 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
rivkode committed Apr 29, 2024
1 parent 9e99ea6 commit 5850c51
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/main/java/com/seoultech/synergybe/domain/post/Post.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.seoultech.synergybe.domain.post;

import com.seoultech.synergybe.domain.comment.Comment;
import com.seoultech.synergybe.domain.common.entity.IsDeleted;
import com.seoultech.synergybe.domain.image.Image;
import com.seoultech.synergybe.domain.post.dto.request.UpdatePostRequest;
import com.seoultech.synergybe.domain.post.vo.PostAuthorName;
Expand All @@ -18,6 +19,8 @@
import java.util.ArrayList;
import java.util.List;

import static com.seoultech.synergybe.domain.common.constants.DeletedStatus.IS_DELETED_DEFAULT;

@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Entity
@Getter
Expand All @@ -28,9 +31,9 @@ public class Post extends BaseTime {
@Column(name = "post_id")
private String id;

@Column(name = "post_sequence")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long postSequence;
// @Column(name = "post_sequence")
// @GeneratedValue(strategy = GenerationType.IDENTITY)
// private Long postSequence;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id")
Expand Down Expand Up @@ -63,6 +66,9 @@ public class Post extends BaseTime {
)
private List<Comment> comments = new ArrayList<>();

@Embedded
private IsDeleted isDeleted = new IsDeleted(IS_DELETED_DEFAULT);

@Builder
public Post(String id, User user, String title, String content, String thumbnailImageId) {
this.id = id;
Expand Down

0 comments on commit 5850c51

Please sign in to comment.