"""empty message

Revision ID: 580bd7f83312
Revises: 2eb74d81b686
Create Date: 2014-08-01 16:59:48.885333

"""

# revision identifiers, used by Alembic.
revision = '580bd7f83312'
down_revision = '2eb74d81b686'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('study_history',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('study_id', sa.Integer(), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('modality', sa.String(length=120), nullable=True),
    sa.Column('action', sa.String(length=120), nullable=True),
    sa.Column('datetime', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['study_id'], ['study.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.add_column(u'study', sa.Column('orthanc_anonymized_id', sa.String(length=120), nullable=True))
    op.drop_column(u'study', u'match_id')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column(u'study', sa.Column(u'match_id', sa.INTEGER(), nullable=True))
    op.drop_column(u'study', 'orthanc_anonymized_id')
    op.drop_table('study_history')
    ### end Alembic commands ###
