Note that there are some explanatory texts on larger screens.

plurals
  1. POHow would you design this DB?
    primarykey
    data
    text
    <p>We are launching a website (paid subscription) and the sign up process includes entering an activation code. Activation codes are printed on scratch cards and sold via offline channels. Some of these cards are for 1 month access. Others are for 3 months and 1 year. Activation codes are unique 10-digit random numbers.</p> <p>When the access expires, users can buy another activation card and extend the subscription by entering the new activation code. Additionally, we should also be able to extend their subscription if they request for it. For example, until a certain date (e.g. 1 additional week).</p> <p>Considering the above information, how would you design the DB for the user-activation_code relationship? Do you think this design is good?</p> <pre><code>tbl_user ---------------- id name status_id tbl_user_status ---------------- id description tbl_activation_code ---------------- activation_code activation_code_type_id activation_code_status_id user_id activated_date expiry_date tbl_activation_code_type ---------------- id description tbl_activation_code_status ---------------- id description </code></pre> <p><strong>Update</strong>: Activation codes will be required only:</p> <p>1) Upon initial sign up</p> <p>2) Closer to the access expiry date (say, 7 days) when the system displays a notification with a link to page to enter the activation code</p> <p>3) After expiry, when a user tries to login, she will be asked for the activation code</p> <p>Therefore, a user is not expected to key in the activation code as and when wanted.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload