codestates / codestates/quokkaBoard-server

[ ✒️ Dev Log] 하승용 / 2021-07-12

Open
#91 0 comments 1 reaction 1 assignee Claimed by @skyupguf View on GitHub
dev_log
Dominant language
TypeScript
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

### 오늘은 어떻게 프로젝트에 기여했나요?
- board와 project, task, tag들의 cascade 재설정, 스키마 리팩터
- tag와 task의 기능로직 테스트 완료, tag의 cascade문제로 project 테이블과 1:N 관계 재설정
- userproject 커스텀 조인테이블이 comment N:M 관계로 추가로 조인테이블을 연결해서 사용 테스트 확인
- task, tag, comment 쿼리에러 버그픽스
- 각각의 컨트롤러 들에 맞는 타입 재정의
- following, follower 자기참조 테이블의 작동테스트 완료

### 오늘의 프로젝트에서 힘든 점은 무엇인가요?
- 자기참조 테이블 관계설정, 커스텀 jointable이나 일반 jointable과는 관계형성 코드 설정이 달라 시행착오가 길었음
- 결론은 아래코드와 같이 참조대상이 또 다른 유저 이기 때문에 user테이블과 following관계를 정의할 follow 테이블에 각각 관계를 설정
- 또 registed 필드를 추가해 한쪽에서 추가할 경우 수락이 될 경우 false => true 변경 시키도록 커스텀 jointable 로 구성
```
// user에서 설정
@OneToMany(() => Follow, follow => follow.following)
following!: Follow[];
@OneToMany(() => Follow, follow => follow.follower)
follower!: Follow[];

// follow에서 설정
@ManyToOne(() => User, user => user.following, {
primary: true, onDelete:'CASCADE'
})
following!: User;
@ManyToOne(() => User, user => user.follower, {
primary: true, onDelete:'CASCADE'
})
```
### 내일은 프로젝트에 기여하기 위해 무엇을 해야 하나요?
- [x] board, task shift 테이블 레코드 작동점검 테스트 완료
- [ ] S3 파일 서버 구축 마무리 테스트, 이미지 업로드 완료
- [ ] 컬럼의 uuid 를 uuidv4 라이브러리로 리팩터(pending)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.