-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
sa.Column("email_address", sa.String(length=255), nullable=False, unique=True), | ||
sa.Column("password_hash", sa.String(length=255), nullable=False), | ||
sa.Column( | ||
"access_token", postgresql.UUID(as_uuid=True), nullable=False, unique=True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably want an index on this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought unique columns don't need to be indexed because unique creates an implicit index? Happy to add one if this is not correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know alchemy, so maybe it does? We should verify that the index gets created though as we'll probably want to lookup by access_token a lot.
sa.Column("id", postgresql.UUID(as_uuid=True), primary_key=True), | ||
sa.Column("organisation_id", postgresql.UUID(as_uuid=True), nullable=False), | ||
sa.Column("name", sa.String(), nullable=False), | ||
sa.Column("email_address", sa.String(length=255), nullable=False, unique=True), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
index? (I'm assuming login is email/password)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
session.rollback() | ||
|
||
|
||
def test_user_empty_email_address_fails(organisation_fixture, session): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a test_user_duplicate_email_address test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call! Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can always fixup the index later if it doesn't get created.
Closes #69. Adds a
user
model based on the proposal in #9.