Building the tables for an Auto-drop subscription system

我的未来我决定 提交于 2019-12-11 17:59:43

问题


I'm building a system that will auto-drop someone from one or more mailing lists, when they subscribe to another mailing list. I have a table 'lists' containing the list names. Each list will have one or more children in the form of 'exclusions', which are basically other lists. Here is my table:

I'm wondering how best to achieve this. I originally thought of having another table called 'exclusions' linked via a lookup table with a many-to-many relationship, then I could grab all the exclusions for a particular list name.

However, the exclusions are basically the same list names that are contained in the lists table, so it seems like I have redundant data there.

Would there be a better way of acheiving this? I considered adding an extra column to the lists table, containing the ID's of the other lists that I need to exclude.


回答1:


I think adding a new table that will link the ID of your list to the ID of the email address would be the best course of action with this. Then when your system goes to send email to a specific list, the lookup can be done on this table using joins to the referenced tables.




回答2:


I found that the answer lies here, in the form of a 'junction' or 'mapping' table: How can I associate one record with another in the same table?



来源:https://stackoverflow.com/questions/25868250/building-the-tables-for-an-auto-drop-subscription-system

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!