"""empty message

Revision ID: d267ab65bb2d
Revises: 7e0b62e52595
Create Date: 2021-04-12 14:32:19.625552

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'd267ab65bb2d'
down_revision = '7e0b62e52595'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('Comment',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('text', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_Comment_id'), 'Comment', ['id'], unique=False)
    op.create_index(op.f('ix_Comment_text'), 'Comment', ['text'], unique=False)
    op.create_table('Participant',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('hash_code', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_Participant_id'), 'Participant', ['id'], unique=False)
    op.create_table('Evaluation',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('survey_id', sa.Integer(), nullable=True),
    sa.Column('evaluation_json', sa.Text(), nullable=True),
    sa.Column('participant_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['participant_id'], ['Participant.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_Evaluation_id'), 'Evaluation', ['id'], unique=False)
    op.create_table('PostEvaluation',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('article_id', sa.Integer(), nullable=True),
    sa.Column('sentiment_id', sa.Integer(), nullable=True),
    sa.Column('privacy_id', sa.Integer(), nullable=True),
    sa.Column('text', sa.Text(), nullable=True),
    sa.Column('evaluation_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['evaluation_id'], ['Evaluation.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_PostEvaluation_id'), 'PostEvaluation', ['id'], unique=False)
    op.create_table('post_evaluation_comment_table',
    sa.Column('post_evaluation_id', sa.Integer(), nullable=True),
    sa.Column('comment_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['comment_id'], ['Comment.id'], ),
    sa.ForeignKeyConstraint(['post_evaluation_id'], ['PostEvaluation.id'], )
    )
    op.create_table('post_evaluation_tag_table',
    sa.Column('post_evaluation_id', sa.Integer(), nullable=True),
    sa.Column('tag_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['post_evaluation_id'], ['PostEvaluation.id'], ),
    sa.ForeignKeyConstraint(['tag_id'], ['Tag.id'], )
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('post_evaluation_tag_table')
    op.drop_table('post_evaluation_comment_table')
    op.drop_index(op.f('ix_PostEvaluation_id'), table_name='PostEvaluation')
    op.drop_table('PostEvaluation')
    op.drop_index(op.f('ix_Evaluation_id'), table_name='Evaluation')
    op.drop_table('Evaluation')
    op.drop_index(op.f('ix_Participant_id'), table_name='Participant')
    op.drop_table('Participant')
    op.drop_index(op.f('ix_Comment_text'), table_name='Comment')
    op.drop_index(op.f('ix_Comment_id'), table_name='Comment')
    op.drop_table('Comment')
    # ### end Alembic commands ###
