Optimal DB structure for a membership website with free and paid subscriptions
There is a regular Users (UserID, UserName, 开发者_如何学PythonEmail, Password) table which handles user registrations.
Which other tables should be added in order to handle paid membership with 2 types of paid subscriptions - Monthly and Yearly.
I think you may want to distinguish between membership details and transactions. I like the idea of adding a membership_type column (should be a tinyint column with a separate lookup table), then having a membership_expiration column as well. If you want to track each membership purchase, you can have a separate transaction table that tracks purchases. This also gives you the ability to expand to other types of purchases or transactions in the future without modifying the data model.
How about adding a membership field to the users table with one of three values- null, monthly, or yearly?
精彩评论