<reponame>anngle/c803<gh_stars>0
"""empty message

Revision ID: <KEY>
Revises: <KEY>
Create Date: 2018-11-17 13:39:16.902372

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

# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<KEY>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('products', 'earnings',
               existing_type=mysql.VARCHAR(length=80),
               nullable='0')
    op.alter_column('roles', 'user_id',
               existing_type=mysql.INTEGER(display_width=11),
               nullable=False)
    op.add_column('users', sa.Column('bankaccount', sa.String(length=30), nullable=True))
    op.add_column('users', sa.Column('bankaddress', sa.String(length=30), nullable=True))
    op.add_column('users', sa.Column('bankcard', sa.String(length=30), nullable=True))
    op.add_column('users', sa.Column('bankname', sa.String(length=30), nullable=True))
    op.add_column('users', sa.Column('openid', sa.Integer(), nullable=True))
    op.add_column('users', sa.Column('opentime', sa.DateTime(), nullable=True))
    op.add_column('users', sa.Column('passcheck', sa.Binary(), nullable=True))
    op.add_column('users', sa.Column('recount', sa.Integer(), nullable=True))
    op.add_column('users', sa.Column('regmoney', sa.String(length=30), nullable=True))
    op.add_column('users', sa.Column('reid', sa.Integer(), nullable=True))
    op.add_column('users', sa.Column('repath', sa.UnicodeText(), nullable=True))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('users', 'repath')
    op.drop_column('users', 'reid')
    op.drop_column('users', 'regmoney')
    op.drop_column('users', 'recount')
    op.drop_column('users', 'passcheck')
    op.drop_column('users', 'opentime')
    op.drop_column('users', 'openid')
    op.drop_column('users', 'bankname')
    op.drop_column('users', 'bankcard')
    op.drop_column('users', 'bankaddress')
    op.drop_column('users', 'bankaccount')
    op.alter_column('roles', 'user_id',
               existing_type=mysql.INTEGER(display_width=11),
               nullable=True)
    op.alter_column('products', 'earnings',
               existing_type=mysql.VARCHAR(length=80),
               nullable=False)
    # ### end Alembic commands ###
