"""alter keysalt

Revision ID: a7a46e1c3a33
Revises: 94080f73ab83
Create Date: 2018-12-11 11:13:13.616768

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision = 'a7a46e1c3a33'
down_revision = '94080f73ab83'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('key_salt')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('key_salt',
    sa.Column('id', mysql.BIGINT(display_width=20), autoincrement=True, nullable=False),
    sa.Column('created_at', mysql.DATETIME(), server_default=sa.text("'0000-00-00 00:00:00'"), nullable=False),
    sa.Column('update_at', mysql.DATETIME(), server_default=sa.text("'0000-00-00 00:00:00'"), nullable=False),
    sa.Column('deleted_at', mysql.DATETIME(), server_default=sa.text("'0000-00-00 00:00:00'"), nullable=False),
    sa.Column('deleted', mysql.TINYINT(display_width=1), server_default=sa.text("'0'"), autoincrement=False, nullable=False),
    sa.Column('user_id', mysql.VARCHAR(length=128), server_default=sa.text("''"), nullable=False),
    sa.Column('user_type', mysql.TINYINT(display_width=1), server_default=sa.text("'0'"), autoincrement=False, nullable=False),
    sa.Column('request_type', mysql.TINYINT(display_width=1), server_default=sa.text("'1'"), autoincrement=False, nullable=False),
    sa.Column('bcrypt_salt', mysql.VARCHAR(length=128), server_default=sa.text("''"), nullable=False),
    sa.Column('server_public_key', mysql.TEXT(), nullable=False),
    sa.Column('server_private_key', mysql.TEXT(), nullable=False),
    sa.Column('share_key', mysql.VARCHAR(length=256), server_default=sa.text("''"), nullable=False),
    sa.Column('client_public_key', mysql.TEXT(), nullable=False),
    sa.Column('nonce', mysql.VARCHAR(length=128), server_default=sa.text("''"), nullable=False),
    sa.Column('user_level', mysql.TINYINT(display_width=1), server_default=sa.text("'0'"), autoincrement=False, nullable=False),
    sa.Column('source', mysql.TINYINT(display_width=4), server_default=sa.text("'1'"), autoincrement=False, nullable=False),
    sa.PrimaryKeyConstraint('id'),
    mysql_default_charset='utf8',
    mysql_engine='InnoDB'
    )
    # ### end Alembic commands ###
