오봉이와 함께하는 개발 블로그
Artineer - Table 설계 본문
728x90
작성 내역
- 2022 05. 16(월) 초안 작성
- 2022 05. 18(수) 테이블 일부 수정(대댓글 구현, 멘토링 테이블 구조), 자료형 명시
- 2022. 09. 22 (수) 댓글, 대댓글 구조를 위해 테이블 구조 변경.
- 테이블, 엔티티 분석 다이어그램 삽입
- 2022. 10. 27 (목) 테이블, 엔티티 분석 다이어그램 변경, UploadFile 테이블 추가, 가입인사(Hello)테이블과 족보(Example)테이블 추가
- 개발 중 변경 사항에 따라 변경함.
- 처음부터 올바른 설계를 하는 것이 개발에 편하다는 것을 알게 되었다.
- 개발 중 변경 사항에 따라 변경함.
- 2022. 11. 05 (토) 엔티티 ERD 수정(기존 글과 댓글의 관계가 양방향으로 되어 있던 것을 단방향(댓글 -> 글)으로 수정
- 원래 단방향으로 설계 했는데 화살표를 잘 못 표기함.
테이블 구조
회원 테이블
- Member
- member_No (NN, PK, AI)(회원 번호) BIGINT
- ID VARCHAR(12)
- Password VARCHAR(15)
- Name VARCHAR(5)
- Year VARCHAR(4)
- Month VARCHAR(2)
- Day VARCHAR(2)
- Email VARCHAR(30)
- firstNumber VARCHAR(3)
- middleNumber VARCHAR(4)
- lastNumber VARCHAR(4)
- Gender CHAR(1)
- Generation (기수) CHAR(1)
- Level VARCHAR(10)
UploadFile 테이블
- UploadFile
- UploadFile_no (NN, PK, AI) BIGINT
- UploadFileName text (파일 업로드 원본 파일 이름)
- StoreFileName text (스토리지에 저장되는 파일 이름 = UUID + 원본 파일 이름)
공지사항 테이블
- Notice
- notice_No (NN, PK, AI)(글 번호) BIGINT
- member_No (Member FK)
- WriteDate (작성일) TIMESTAMP
- Title (제목) TEXT
- Detail (내용) TEXT
- UploadFile_No BIGINT (UploadFile FK)
- View (조회수) BIGINT
- constraint FK_Notice_Member FOREIGN KEY (member_No) REFERENCES Member (member_No)
- constraint FK_Notice_UploadFile FOREIGN KEY (UploadFile_No) REFERENCES UploadFile (UploadFile_No)
- Notice_Comment
- noticeComment_No (NN, PK, AI)(댓글 번호) INT
- member_No (Member FK) BIGINT
- Detail (내용) TEXT
- WriteDate (작성일) TIMESTAMP
- notice_No (Notice FK) BIGINT
- parentComment_No BIGINT
- constraint FK_NoticeComment_Member FOREIGN KEY (member_No) REFERENCES Member (member_No)
- constraint FK_NoticeComment_Notice FOREIGN KEY (notice_No) REFERENCES Notice (notice_No)
회의록 테이블
- Meeting
- meeting_No (NN, PK, AI)(글 번호) BIGINT
- member_No (Member FK)
- WriteDate (작성일) TIMESTAMP
- Title (제목) TEXT
- Detail (내용) TEXT
- UploadFile_No BIGINT (UploadFile FK)
- View (조회수) BIGINT
- constraint FK_Meeting_Member FOREIGN KEY (member_No) REFERENCES Member (member_No)
- constraint FK_Meeting_UploadFile FOREIGN KEY (UploadFile_No) REFERENCES UploadFile (UploadFile_No)
- Meeting_Comment
- meetingComment_No (NN, PK, AI)(댓글 번호) INT
- member_No (Member FK) BIGINT
- Detail (내용) TEXT
- WriteDate (작성일) TIMESTAMP
- meeting_No (Notice FK) BIGINT
- parentComment_No BIGINT
- constraint FK_MeetingComment_Member FOREIGN KEY (member_No) REFERENCES Member (member_No)
- constraint FK_MeetingComment_Meeting FOREIGN KEY (meeting_No) REFERENCES Meeting (meeting_No)
멘토링 테이블 (2022. 09. 21 (수) 수정내용 : 추후 구현)
MentoringNo (NN, PK, AI)(글 번호) INTMentoName VARCHAR(5)Generation (기수) CHAR(1)Title VARCHAR(30)Detail VARCHAR(100)
프로젝트 테이블
- Project
- project_No (NN, PK, AI)(글 번호) BIGINT
- member_No (Member FK)
- WriteDate (작성일) TIMESTAMP
- Title (제목) TEXT
- Detail (내용) TEXT
- UploadFile_No BIGINT (UploadFile FK)
- View (조회수) BIGINT
- constraint FK_Project_Member FOREIGN KEY (member_No) REFERENCES Member (member_No)
- constraint FK_Project_UploadFile FOREIGN KEY (UploadFile_No) REFERENCES UploadFile (UploadFile_No)
- Project_Comment
- projectComment_No (NN, PK, AI)(댓글 번호) INT
- member_No (Member FK) BIGINT
- Detail (내용) TEXT
- WriteDate (작성일) TIMESTAMP
- project_No (Notice FK) BIGINT
- parentComment_No BIGINT
- constraint FK_ProjectComment_Member FOREIGN KEY (member_No) REFERENCES Member (member_No)
- constraint FK_ProjectComment_Project FOREIGN KEY (project_No) REFERENCES Project (project_No)
자료실 테이블
- Reference
- reference_No (NN, PK, AI)(글 번호) BIGINT
- member_No (Member FK)
- WriteDate (작성일) TIMESTAMP
- Title (제목) TEXT
- Detail (내용) TEXT
- UploadFile_No BIGINT (UploadFile FK)
- View (조회수) BIGINT
- constraint FK_Reference_Member FOREIGN KEY (member_No) REFERENCES Member (member_No)
- constraint FK_Reference_UploadFile FOREIGN KEY (UploadFile_No) REFERENCES UploadFile (UploadFile_No)
- Reference_Comment
- referenceComment_No (NN, PK, AI)(댓글 번호) INT
- member_No (Member FK) BIGINT
- Detail (내용) TEXT
- WriteDate (작성일) TIMESTAMP
- reference_No (Notice FK) BIGINT
- parentComment_No BIGINT
- constraint FK_Reference_Member FOREIGN KEY (member_No) REFERENCES Member (member_No)
- constraint FK_Reference_UploadFile FOREIGN KEY (UploadFile_No) REFERENCES UploadFile (UploadFile_No)
갤러리 테이블
- Gallery
- gallery_No (NN, PK, AI)(글 번호) BIGINT
- member_No (Member FK)
- WriteDate (작성일) TIMESTAMP
- Title (제목) TEXT
- Detail (내용) TEXT
- UploadFile_No BIGINT (UploadFile FK)
- View (조회수) BIGINT
- constraint FK_Gallery_Member FOREIGN KEY (member_No) REFERENCES Member (member_No)
- constraint FK_Gallery_UploadFile FOREIGN KEY (UploadFile_No) REFERENCES UploadFile (UploadFile_No)
- Gallery_Comment
- galleryComment_No (NN, PK, AI)(댓글 번호) INT
- member_No (Member FK) BIGINT
- Detail (내용) TEXT
- WriteDate (작성일) TIMESTAMP
- gallery_No (Notice FK) BIGINT
- parentComment_No BIGINT
- constraint FK_GalleryComment_Member FOREIGN KEY (member_No) REFERENCES Member (member_No)
- constraint FK_GalleryComment_Gallery FOREIGN KEY (gallery_No) REFERENCES Gallery (gallery_No)
시험족보 테이블
- Example
- example_No (NN, PK, AI)(글 번호) BIGINT
- member_No (Member FK)
- WriteDate (작성일) TIMESTAMP
- Title (제목) TEXT
- Detail (내용) TEXT
- UploadFile_No BIGINT (UploadFile FK)
- View (조회수) BIGINT
- constraint FK_Example_Member FOREIGN KEY (member_No) REFERENCES Member (member_No)
- constraint FK_Example_UploadFile FOREIGN KEY (UploadFile_No) REFERENCES UploadFile (UploadFile_No)
- Example_Comment
- exampleComment_No (NN, PK, AI)(댓글 번호) INT
- member_No (Member FK) BIGINT
- Detail (내용) TEXT
- WriteDate (작성일) TIMESTAMP
- example_No (Notice FK) BIGINT
- parentComment_No BIGINT
- constraint FK_ExampleComment_Member FOREIGN KEY (member_No) REFERENCES Member (member_No)
- constraint FK_ExampleComment_Example FOREIGN KEY (example_No) REFERENCES Example (example_No)
가입인사 테이블
- Hello
- hello_No (NN, PK, AI)(글 번호) BIGINT
- member_No (Member FK)
- WriteDate (작성일) TIMESTAMP
- Title (제목) TEXT
- Detail (내용) TEXT
- View (조회수) BIGINT
- constraint FK_Hello_Member FOREIGN KEY (member_No) REFERENCES Member (member_No)
- Hello_Comment
- helloComment_No (NN, PK, AI)(댓글 번호) INT
- member_No (Member FK) BIGINT
- Detail (내용) TEXT
- WriteDate (작성일) TIMESTAMP
- hello_No (Notice FK) BIGINT
- parentComment_No BIGINT
- constraint FK_HelloComment_Member FOREIGN KEY (member_No) REFERENCES Member (member_No)
- constraint FK_HelloComment_Hello FOREIGN KEY (hello_no) REFERENCES Hello (hello_No)
테이블 분석
보기 불편하지만 간단하게 설명하면 각 게시판 테이블(Notice, Project, Reference, Gallery, Meeting, Hello, Example)과 댓글 테이블(Notice_Comment, Project_Comment, Reference_Comment, Gallery_Comment, Meeting_Comment, Hello_Comment, Example_Comment)은 Member와 연관되어 있고, 게시판 테이블(Notice, Project, Reference, Gallery, Meeting, Example)은 UploadFile테이블과 연관되어 있다.
엔티티 분석
728x90
'Artineer 리뉴얼 프로젝트' 카테고리의 다른 글
중단 (0) | 2022.05.26 |
---|---|
Artineer - 프로젝트 패키지 구조 (0) | 2022.05.20 |
Artineer - 테이블 생성 쿼리문 (0) | 2022.05.19 |
Artineer - 게시글 댓글 작성 기능(대댓글 포함) (0) | 2022.05.18 |
백엔드 중점 프로젝트 (Artineer 홈페이지) (0) | 2022.05.15 |
Comments