+----------+ +------------+
|users | |tasks |
+----------+ +------------+
|*email | /|*name |
|first_name+------------+description |
|last_name | \|due_date |
| | |user_id |
+----+-----+ |task_list_id|
| +------+-----+
| \|/
| |
| |
| |
/|\ |
+-----+-------+ +-----+-----+
|shared_lists | |task_lists |
+-------------+ +-----------+
|*task_list_id|\ |*name |
|*user_id +-----------+description|
| |/ | |
| | | |
+-------------+ +-----------+
- a user has many tasks
- a task belongs to a user
- a task belongs to a task_list
- a task_list has many tasks
- a task_list has many users through shared_lists
- a user has many task_lists through shared_lists
- a shared_list belongs to a user
- a shared_list belongs to a task_list