"""rename a column name in account_admins

Revision ID: 4c32365bb655
Revises: e1d390d440d5
Create Date: 2021-02-14 20:27:23.992720

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '4c32365bb655'
down_revision = 'e1d390d440d5'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('account_admins', schema=None) as batch_op:
        batch_op.alter_column('github_login', new_column_name='git_hub_login', existing_type=sa.Text())
        # batch_op.add_column(sa.Column('git_hub_login', sa.Text(), nullable=False))
        # batch_op.drop_constraint('uq_account_admins_github_login', type_='unique')
        # batch_op.create_unique_constraint(batch_op.f('uq_account_admins_git_hub_login'), ['git_hub_login'])
        # batch_op.drop_column('github_login')

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('account_admins', schema=None) as batch_op:
        batch_op.alter_column('git_hub_login', new_column_name='github_login', existing_type=sa.Text())
        # batch_op.add_column(sa.Column('github_login', sa.TEXT(), nullable=False))
        # batch_op.drop_constraint(batch_op.f('uq_account_admins_git_hub_login'), type_='unique')
        # batch_op.create_unique_constraint('uq_account_admins_github_login', ['github_login'])
        # batch_op.drop_column('git_hub_login')

    # ### end Alembic commands ###
