"""'读者和读者等级'

Revision ID: a6ed71f3a655
Revises: 
Create Date: 2020-09-17 17:03:38.341232

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'a6ed71f3a655'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('reader_grade',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('grand_name', sa.String(length=50), nullable=True),
    sa.Column('quan_tity', sa.Integer(), nullable=True),
    sa.Column('max_maney', sa.Float(), nullable=True),
    sa.Column('date_amount', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('reader',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('reader_name', sa.String(length=50), nullable=False),
    sa.Column('reader_char', sa.String(length=10), nullable=True),
    sa.Column('reader_pass', sa.String(length=50), nullable=False),
    sa.Column('reader_credit', sa.Integer(), nullable=True),
    sa.Column('address', sa.String(length=50), nullable=True),
    sa.Column('phone', sa.String(length=11), nullable=True),
    sa.Column('grand_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['grand_id'], ['reader_grade.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('reader')
    op.drop_table('reader_grade')
    # ### end Alembic commands ###
