"""empty message

Revision ID: a5537caad779
Revises: None
Create Date: 2016-07-11 16:12:50.140114

"""

# revision identifiers, used by Alembic.
revision = 'a5537caad779'
down_revision = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('role',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=50), nullable=True),
    sa.Column('description', sa.String(length=255), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('name')
    )
    op.create_table('user',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('email', sa.String(length=255), nullable=True),
    sa.Column('password', sa.String(length=255), nullable=True),
    sa.Column('mobile', sa.String(length=30), nullable=True),
    sa.Column('name', sa.String(), nullable=True),
    sa.Column('active', sa.Boolean(), nullable=True),
    sa.Column('confirmed_at', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('email')
    )
    op.create_table('suit',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('plaintiff_id', sa.Integer(), nullable=True),
    sa.Column('defendant_id', sa.Integer(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('accepted', sa.DateTime(), nullable=True),
    sa.Column('payment_id', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['defendant_id'], ['user.id'], ),
    sa.ForeignKeyConstraint(['plaintiff_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('user_roles',
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('role_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['role_id'], ['role.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], )
    )
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('user_roles')
    op.drop_table('suit')
    op.drop_table('user')
    op.drop_table('role')
    ### end Alembic commands ###
