anitab-org / anitab-org/mentorship-backend

Change database design for tasks_list table

Đang mở
#402 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
200
Fork
449
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**Is your feature request related to a problem? Please describe.**
While working on a task to create API endpoints for commenting, I had difficulty working with the tasks_list table. Unlike users or mentorship relations, task_list data is stored in JSON and not linear format. However this has some disadvantages.
1. No unique ID to identify a task. Every task for a mentorship relation begins with ID=1. So a combination of keys must be used (request_id, task_id).
2. We can't directly retrieve a single task. Entire task list for a relation gets retrieved and then we have to loop through it.
3. Comments have a many is to one relation with tasks. Having some join feature will be good.

#### Database table comparison
1. Users
![image](https://user-images.githubusercontent.com/50169911/72668123-8369e400-3a49-11ea-9ca7-36d618fe872d.png)

2. mentorship_relations
![image](https://user-images.githubusercontent.com/50169911/72668140-a09eb280-3a49-11ea-98a6-5c736a34f840.png)

3. tasks_list
![image](https://user-images.githubusercontent.com/50169911/72668155-ba3ffa00-3a49-11ea-8cd7-ccabb504025a.png)

**Describe the solution you'd like**
Store each task in a separate row. id, description, is_done and other parameters should be separate columns.

**Describe alternatives you've considered**
None

**Additional context**
The GCI task I have done: https://github.com/systers/mentorship-backend/pull/398

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.