Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 428259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:39:29+00:00 2026-05-12T19:39:29+00:00

We are launching a website (paid subscription) and the sign up process includes entering

  • 0

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.

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).

Considering the above information, how would you design the DB for the user-activation_code relationship? Do you think this design is good?

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

Update: Activation codes will be required only:

1) Upon initial sign up

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

3) After expiry, when a user tries to login, she will be asked for the activation code

Therefore, a user is not expected to key in the activation code as and when wanted.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T19:39:29+00:00Added an answer on May 12, 2026 at 7:39 pm

    It’s not bad. However, I would suggest that you add two fields to tbl_user:

    tbl_user
    ----------------
    id
    name
    status_id
    activated_date
    expiry_date
    

    Of course, activated_date holds the date they were first activated, while expiry_date holds the date when they will expire. You also need a procedure to update this expiry_date, whenever they buy a new card. This procedure should handle two cards with overlapping dates, so the user doesn’t double-up payment for a particular period. For example:

    • Card 1 – Sep 1 to Sep 30
    • Card 2 – Sep 16 to Oct 15

    There are fifteen days of overlap there, so the user’s activated_date should be Sep 1, while their expiry_date should be Oct 30 (Oct 15 + 15 days).

    Considering this, I would change tbl_activation_code, as expiry_date becomes a bit misleading. Instead, create a column called access_days that will be used to calculate the user’s expiry_date.

    Also, if you want to remember cards that were issued, even if not activated, then I would split tbl_activation_code into two tables:

    tbl_activation_code
    ----------------
    activation_code
    activation_code_type_id
    activation_code_status_id
    access_days
    
    tbl_activation
    ----------------
    activation_code_id
    user_id
    activated_date
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating an ASP.Net MVC website that I am launching soon in private
Launching code on document ready is a pillar of jQuery. But sometimes, lengthy operations
I'm launching this big database (1.5+ million records) driven website and I want to
I realise it's vry soon after launching, but I'm keen to develop website in
I have a query regarding launching a native application from a link of website
When launching a thread or a process in .NET or Java, is there a
When launching a process from Java, both stderr and stdout can block on output
When launching a process with CreateProcessW() , is it possible to have the process
I am launching a child process with ProcessBuilder, and need the child process to
when launching the following code in ADL, why does the square continue to rotate?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.