"""empty message

Revision ID: c2f65a03dbdb
Revises: 
Create Date: 2018-05-03 18:18:27.470606

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('User',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('date_created', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
    sa.Column('date_modified', sa.DateTime(), nullable=True),
    sa.Column('name', sa.String(length=250), nullable=False),
    sa.Column('email', sa.String(length=250), nullable=True),
    sa.Column('image_url', sa.String(), nullable=False),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('email')
    )
    op.create_table('Team',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('date_created', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
    sa.Column('date_modified', sa.DateTime(), nullable=True),
    sa.Column('name', sa.String(length=128), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['User.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('Collection',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('date_created', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
    sa.Column('date_modified', sa.DateTime(), nullable=True),
    sa.Column('name', sa.String(length=128), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('team_id', sa.Integer(), nullable=True),
    sa.Column('interval', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['team_id'], ['Team.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['User.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('team_members',
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('team_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['team_id'], ['Team.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['User.id'], )
    )
    op.create_table('Request',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('date_created', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
    sa.Column('date_modified', sa.DateTime(), nullable=True),
    sa.Column('collection_id', sa.Integer(), nullable=True),
    sa.Column('method', sa.String(length=128), nullable=False),
    sa.Column('body', sa.String(length=255), nullable=True),
    sa.Column('url', sa.String(length=255), nullable=False),
    sa.ForeignKeyConstraint(['collection_id'], ['Collection.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('ResponseSummary',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('date_created', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
    sa.Column('date_modified', sa.DateTime(), nullable=True),
    sa.Column('status', sa.String(), nullable=False),
    sa.Column('failures', sa.Integer(), nullable=False),
    sa.Column('run_from', sa.String(), nullable=True),
    sa.Column('collection_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['collection_id'], ['Collection.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('Header',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('date_created', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
    sa.Column('date_modified', sa.DateTime(), nullable=True),
    sa.Column('key', sa.String(), nullable=False),
    sa.Column('value', sa.String(), nullable=False),
    sa.Column('request_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['request_id'], ['Request.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('RequestAssertion',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('date_created', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
    sa.Column('date_modified', sa.DateTime(), nullable=True),
    sa.Column('assertion_type', sa.String(), nullable=False),
    sa.Column('comparison', sa.String(), nullable=False),
    sa.Column('value', sa.Integer(), nullable=False),
    sa.Column('request_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['request_id'], ['Request.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('Response',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('date_created', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
    sa.Column('date_modified', sa.DateTime(), nullable=True),
    sa.Column('status_code', sa.Integer(), nullable=False),
    sa.Column('status', sa.String(), nullable=True),
    sa.Column('failures', sa.Integer(), nullable=False),
    sa.Column('response_time', sa.Integer(), nullable=True),
    sa.Column('data', sa.String(), nullable=False),
    sa.Column('headers', sa.String(), nullable=False),
    sa.Column('request_id', sa.Integer(), nullable=False),
    sa.Column('response_summary_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['request_id'], ['Request.id'], ),
    sa.ForeignKeyConstraint(['response_summary_id'], ['ResponseSummary.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('ResponseAssertion',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('date_created', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
    sa.Column('date_modified', sa.DateTime(), nullable=True),
    sa.Column('assertion_type', sa.String(), nullable=False),
    sa.Column('comparison', sa.String(), nullable=False),
    sa.Column('value', sa.Integer(), nullable=False),
    sa.Column('status', sa.String(), nullable=True),
    sa.Column('request_assertion_id', sa.Integer(), nullable=False),
    sa.Column('response_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['request_assertion_id'], ['RequestAssertion.id'], ),
    sa.ForeignKeyConstraint(['response_id'], ['Response.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('ResponseAssertion')
    op.drop_table('Response')
    op.drop_table('RequestAssertion')
    op.drop_table('Header')
    op.drop_table('ResponseSummary')
    op.drop_table('Request')
    op.drop_table('team_members')
    op.drop_table('Collection')
    op.drop_table('Team')
    op.drop_table('User')
    # ### end Alembic commands ###
