Suppose, there are some tasks and some sub-tasks under those tasks
For example:
Task 1 Sub task 1.1 Sub task 1.2 Sub task 1.3 Sub task 1.4 Task 2 Sub task 2.1 Sub task 2.2 Sub task 2.3
what is the best way to design the schema in this situation?
First way:
"Task" Table ==================================== task_id | task_name | description ==================================== "Sub Task" Table ========================================================================================================================== sub_task_id | task_id | sub_task_name | description | attachment_link | start_date | due_date | status ==========================================================================================================================
Second Way:
====================================================================================================================================== id | name | description | parent_id | attachment_link | start_date | due_date | status | type(task/subtask) ======================================================================================================================================
Which one is preferable?