"""empty message

Revision ID: 573fb018da4e
Revises: None
Create Date: 2014-05-27 17:09:16.679723

"""

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

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('researchID',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('research_id', sa.String(length=120), nullable=True),
    sa.Column('used', sa.Boolean(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('research_id')
    )
    op.create_table('person',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('research_id', sa.String(length=120), nullable=True),
    sa.Column('clinical_id', sa.String(length=120), nullable=True),
    sa.Column('first_name', sa.String(length=120), nullable=True),
    sa.Column('last_name', sa.String(length=120), nullable=True),
    sa.Column('dob', sa.Date(), nullable=True),
    sa.Column('ssn', sa.String(length=11), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('clinical_id'),
    sa.UniqueConstraint('research_id')
    )
    op.create_table('user',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('username', sa.String(length=80), nullable=True),
    sa.Column('email', sa.String(length=120), nullable=True),
    sa.Column('password', sa.String(length=120), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('email'),
    sa.UniqueConstraint('username')
    )
    op.create_table('study',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('orthanc_id', sa.String(length=120), nullable=True),
    sa.Column('person_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['person_id'], ['person.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('orthanc_id')
    )
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('study')
    op.drop_table('user')
    op.drop_table('person')
    op.drop_table('researchID')
    ### end Alembic commands ###
