Skip to content

Commit

Permalink
sync schema with models
Browse files Browse the repository at this point in the history
Add missing changes in models-removing unique constraint for email_id.
Respective migration file 9yuk6g899741_.py
  • Loading branch information
Ilavarasi12 authored and tourunen committed Nov 6, 2019
1 parent e849ca2 commit 3a2bc77
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions pebbles/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,8 @@ class User(db.Model):
id = db.Column(db.String(32), primary_key=True)
# eppn is manadatory and database objects are retrieved based on eppn
_eppn = db.Column('eppn', db.String(MAX_EMAIL_LENGTH), unique=True)
# email_id field is used only for sending emails. If it is not null it should be unique
"""
Earlier, User can have two separate accounts based on eppn (through sso) and
email(through invite-only). From now on only one account will be allowed.
For new users: Uniqueness of email_id does not allow users to have two accounts
like "eppn@example.org" and "firstname.lastname@example.org", because both will
have the same email_id.
For old users: If the user already has two accounts like "eppn@example.org" and
"firstname.lastname@example.org", the first account user logs in will update his
email_id and by deafult second account will become inaccessible.
"""
_email_id = db.Column('email_id', db.String(MAX_EMAIL_LENGTH), unique=True)
# email_id field is used only for sending emails.
_email_id = db.Column('email_id', db.String(MAX_EMAIL_LENGTH))
password = db.Column(db.String(MAX_PASSWORD_LENGTH))
joining_date = db.Column(db.DateTime)
expiry_date = db.Column(db.DateTime)
Expand Down

0 comments on commit 3a2bc77

Please sign in to comment.