"""rename the table github_admin_app_token github_tokens

Revision ID: bad578ddbf3a
Revises: 63033c01def0
Create Date: 2020-12-26 13:14:55.257552

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'bad578ddbf3a'
down_revision = '63033c01def0'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.rename_table('github_admin_app_token', 'github_tokens')
    # op.create_table('github_tokens',
    # sa.Column('token_id', sa.Integer(), nullable=False),
    # sa.Column('token', sqlalchemy_utils.types.encrypted.encrypted_type.EncryptedType(), nullable=True),
    # sa.Column('scope', sa.Text(), nullable=True),
    # sa.Column('user_id', sa.Integer(), nullable=False),
    # sa.ForeignKeyConstraint(['user_id'], ['github_users.user_id'], name=op.f('fk_github_tokens_user_id_github_users')),
    # sa.PrimaryKeyConstraint('token_id', name=op.f('pk_github_tokens'))
    # )
    # op.drop_table('github_admin_app_token')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.rename_table('github_tokens', 'github_admin_app_token')
    # op.create_table('github_admin_app_token',
    # sa.Column('token_id', sa.INTEGER(), nullable=False),
    # sa.Column('token', sa.BLOB(), nullable=True),
    # sa.Column('scope', sa.TEXT(), nullable=True),
    # sa.Column('user_id', sa.INTEGER(), nullable=False),
    # sa.ForeignKeyConstraint(['user_id'], ['github_users.user_id'], name='fk_github_admin_app_token_user_id_github_users'),
    # sa.PrimaryKeyConstraint('token_id', name='pk_admin_app_token')
    # )
    # op.drop_table('github_tokens')
    # ### end Alembic commands ###
