Skip to content

Commit

Permalink
✨ feat(domain): add announcement entity (#474)
Browse files Browse the repository at this point in the history
  • Loading branch information
siyeonSon authored Jun 6, 2024
1 parent fdb991a commit a80138d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.depromeet.announcement;

import static lombok.AccessLevel.PROTECTED;

import com.depromeet.common.entity.BaseTimeEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor(access = PROTECTED)
@Entity
public class Announcement extends BaseTimeEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "announcement_id")
private Long id;

@Column(nullable = false, length = 200)
private String title;

@Column(nullable = false, length = 3000)
private String content;

@Builder
public Announcement(String title, String content) {
this.title = title;
this.content = content;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE TABLE IF NOT EXISTS announcement (
announcement_id BIGINT NOT NULL AUTO_INCREMENT,
title VARCHAR(200) NOT NULL,
content VARCHAR(3000) NOT NULL,
created_at DATETIME(6) NOT NULL,
modified_at DATETIME(6) NOT NULL
)

0 comments on commit a80138d

Please sign in to comment.