"""empty message

Revision ID: 29daf0a927c8
Revises: dc0d6d864c1e
Create Date: 2019-03-28 17:48:49.439096

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '29daf0a927c8'
down_revision = 'dc0d6d864c1e'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('apis',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=128), nullable=True),
    sa.Column('url', sa.String(length=128), nullable=True),
    sa.Column('version', sa.String(length=16), nullable=True),
    sa.Column('note', sa.String(length=128), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('user_apis',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('api_id', sa.Integer(), nullable=False),
    sa.Column('monthly_requests', sa.Integer(), nullable=True),
    sa.Column('total_requests', sa.Integer(), nullable=True),
    sa.Column('note', sa.String(length=128), nullable=True),
    sa.ForeignKeyConstraint(['api_id'], ['apis.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


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