pyfedi/migrations/versions/2cae414cbc7a_alt_user_names.py
2024-08-20 07:03:18 +12:00

34 lines
971 B
Python

"""alt user names
Revision ID: 2cae414cbc7a
Revises: f1f38dabd541
Create Date: 2024-08-19 19:38:36.616993
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2cae414cbc7a'
down_revision = 'f1f38dabd541'
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.add_column(sa.Column('alt_user_name', sa.String(length=255), nullable=True))
batch_op.create_index(batch_op.f('ix_user_alt_user_name'), ['alt_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_alt_user_name'))
batch_op.drop_column('alt_user_name')
# ### end Alembic commands ###