Fix username being case-sensitive
This commit is contained in:
35
migrations/versions/28a427cbd4cf_.py
Normal file
35
migrations/versions/28a427cbd4cf_.py
Normal file
@@ -0,0 +1,35 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 28a427cbd4cf
|
||||
Revises: e9f534df23a8
|
||||
Create Date: 2018-06-03 01:47:33.006039
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlalchemy.types as ty
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '28a427cbd4cf'
|
||||
down_revision = 'e9f534df23a8'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('user','username', type_=ty.VARCHAR(50, collation='NOCASE'))
|
||||
op.alter_column('user','github_username', type_=ty.VARCHAR(50, collation='NOCASE'))
|
||||
op.alter_column('user','forums_username', type_=ty.VARCHAR(50, collation='NOCASE'))
|
||||
op.create_index(op.f('ix_user_username'), 'user', ['username'], unique=True)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('user','username', type_=ty.VARCHAR(50))
|
||||
op.alter_column('user','github_username', type_=ty.VARCHAR(50))
|
||||
op.alter_column('user','forums_username', type_=ty.VARCHAR(50))
|
||||
op.drop_index(op.f('ix_user_username'), table_name='user')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user