I'm creating a feature to allow lots of different types of things to be added to lists. A list has some basic elements like a name and description and owner id.
So my first data model is
List:
list_id
list_name
list_description
list_owner_id
And my second data model looks something like:
List Items:
list_item_id
list_id
rank/order
I'm trying to decide some basic things:
should I:
make a generic list table that specifies the types of items that it's list elements point at, i.e. (List: element_type) or
make separate list tables for each type of list or i.e. (Product_List, Product_List_Items , Comment_List, Comment_List_Items)
make the list elements point at a generic "listable" element that then finalizes/specifies the type of the thing pointed at for final lookup. i.e List_Items: element_type
- or some other thing
If I do option 1, I can select a list from the list table, then choose to do joins based on knowing the final element table to join against
If I choose 2, I will always have static relationships that are well defined, with only specific data in each table
If I choose 3, I will be able to store a variety of things in each list, but this is not a requirement at this time.
Update: my question is similar to this:
DB design to use sub-type or not?
but instead of a one to one relationship I have a one to many...