pyfedi/migrations/versions/84a5cb2a5e5b_remove_unique_on_user.py
2023-11-22 20:48:27 +13:00

34 lines
955 B
Python

"""remove unique on user
Revision ID: 84a5cb2a5e5b
Revises: 6a9bec0c492e
Create Date: 2023-11-22 19:47:40.609945
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '84a5cb2a5e5b'
down_revision = '6a9bec0c492e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('user', schema=None) as batch_op:
batch_op.drop_index('ix_user_user_name')
batch_op.create_index(batch_op.f('ix_user_user_name'), ['user_name'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('user', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_user_user_name'))
batch_op.create_index('ix_user_user_name', ['user_name'], unique=False)
# ### end Alembic commands ###