-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add case insensitive constraint to username #27266
Conversation
6cd76b1
to
3e62246
Compare
c2c89fd
to
e837edf
Compare
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 feel like we should add a pre-migration check to look for duplicates before it fails the migration? Like we do for duplicated connection ids?
072031e
to
f126955
Compare
airflow/utils/db.py
Outdated
f'Seems you have non unique username in {model.__table__.name} table.\n' # type: ignore | ||
'You have to manage those duplicate usernames ' |
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.
This needs to say something about mixed-case, as otherwise users could be forgiven for thinking that Test
and test
are different users.
And "manage" isn't clear either -> "delete or rename"
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.
Addressed. You can take another look. Thanks
f126955
to
e636694
Compare
This helps us to recognize usernames properly fixup! Add case insensitive constraint to username check username is unique in check migrations
e636694
to
aed1279
Compare
if dups: | ||
yield ( | ||
f'Seems you have mixed case usernames in {model.__table__.name} table.\n' # type: ignore | ||
'You have to rename or delete those mixed case usernames ' |
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.
❤️ love the detailed error message
This helps us to recognize usernames properly (cherry picked from commit 1d25105)
This helps us to recognize usernames properly (cherry picked from commit 1d25105)
This helps us to recognize usernames properly