stopstalk / stopstalk-deployment

Stop stalking and start StopStalking :wink:
https://www.stopstalk.com
MIT License
313 stars 96 forks source link

Whole new DB schema. Maybe a lot efficient, faster and less memory consuming. #15

Open raj454raj opened 8 years ago

raj454raj commented 8 years ago

Instead of storing the handles and sites in the auth_user table have a table having site handles and site names and then make id of this table as the foreign key for auth_user table.

Also make a problem table(extend current problem_tags table) and just include problem_id in a submission.

raj454raj commented 8 years ago

New proposed schema:

auth_user
first_name
last_name
email
password
institute
_referrer(ref authuser)
_codechefhandle(ref handle)
_codeforceshandle(ref handle)
_spojhandle(ref handle)
_hackerearthhandle(ref handle)
_hackerrankhandle(ref handle)

handle
name
site

problem
name
link
tags
site

submission
stopstalk_handle
_submissionhandle(ref handle)
time_stamp
problem(ref problem)
lang
status
points
view_link

custom_friend
_user_id(ref authuser)
first_name
last_name
institute
_duplicate_cu(ref customfriend)
_referrer(ref authuser)
_codechefhandle(ref handle)
_codeforceshandle(ref handle)
_spojhandle(ref handle)
_hackerearthhandle(ref handle)
_hackerrankhandle(ref handle)

trending_problem
_problemid (ref problem)
_submissioncount
_usercount