Skip to content

Commit

Permalink
feat: sql settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeongh00 committed Nov 17, 2023
1 parent ed93bf2 commit 07f6865
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,4 @@ public class NoticeTeam extends BaseEntity {

private String teamName;

@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "notice_id")
private Notice notice;

}
50 changes: 27 additions & 23 deletions core-module/src/main/resources/V1__init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,13 @@ CREATE TABLE member
(
member_id BIGINT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255),
"period" VARCHAR(255),
email VARCHAR(255),
profile_image_url VARCHAR(255),
phone_number VARCHAR(255),
password VARCHAR(255),
authority VARCHAR(50)
);

CREATE TABLE memberinfo
(
member_info_id BIGINT AUTO_INCREMENT PRIMARY KEY,
major VARCHAR(255),
part VARCHAR(255),
phone_number VARCHAR(20),
description TEXT,
member_id BIGINT,
FOREIGN KEY (member_id) REFERENCES member (member_id)
fcm_token VARCHAR(255),
authority VARCHAR(50),
is_deleted BOOLEAN
);

CREATE TABLE curriculum
Expand All @@ -29,27 +21,39 @@ CREATE TABLE curriculum

CREATE TABLE notice
(
notice_id BIGINT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255),
content TEXT,
member_id BIGINT,
curriculum_id BIGINT,
notice_id BIGINT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255),
content TEXT,
is_deleted BOOLEAN,
member_id BIGINT,
curriculum_id BIGINT,
notice_team_id BIGINT,
notice_image_id BIGINT,
notice_view_id BIGINT,
FOREIGN KEY (member_id) REFERENCES member (member_id),
FOREIGN KEY (curriculum_id) REFERENCES curriculum (curriculum_id)
FOREIGN KEY (curriculum_id) REFERENCES curriculum (curriculum_id),
FOREIGN KEY (notice_team_id) REFERENCES notice_team (notice_team_id),
FOREIGN KEY (notice_image_id) REFERENCES notice_image (notice_image_id),
FOREIGN KEY (notice_view_id) REFERENCES notice_view (notice_view_id)
);

CREATE TABLE notice_image
(
notice_image_id BIGINT AUTO_INCREMENT PRIMARY KEY,
image_url VARCHAR(255),
is_deleted BOOLEAN
);

CREATE TABLE notice_team
(
notice_team_id BIGINT AUTO_INCREMENT PRIMARY KEY,
team_name VARCHAR(255),
notice_id BIGINT,
FOREIGN KEY (notice_id) REFERENCES notice (notice_id)
team_name VARCHAR(255)
);

CREATE TABLE notice_view
(
notice_view_id BIGINT AUTO_INCREMENT PRIMARY KEY,
view_count INT,
view VARCHAR(255),
member_id BIGINT,
notice_id BIGINT,
FOREIGN KEY (member_id) REFERENCES member (member_id),
Expand Down

0 comments on commit 07f6865

Please sign in to comment.