"""empty message

Revision ID: <KEY>
Revises: <KEY>8
Create Date: 2020-07-13 20:55:18.016855

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '151f9c8b<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('survey_annotations',
    sa.Column('id', sa.String(length=150), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('survey_record_id', sa.String(length=150), nullable=True),
    sa.Column('annotation_sentence_id', sa.String(length=150), nullable=True),
    sa.Column('sentence_group_id', sa.Integer(), nullable=True),
    sa.Column('label', sa.Integer(), nullable=False),
    sa.Column('words', sa.Text(), nullable=False),
    sa.Column('factual', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['annotation_sentence_id'], ['annotation_sentences.id'], ),
    sa.ForeignKeyConstraint(['sentence_group_id'], ['survey_groups.id'], ),
    sa.ForeignKeyConstraint(['survey_record_id'], ['survey_record.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('test_survey_annotations',
    sa.Column('id', sa.String(length=150), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('survey_record_id', sa.String(length=150), nullable=True),
    sa.Column('annotation_sentence_id', sa.String(length=150), nullable=True),
    sa.Column('sentence_group_id', sa.Integer(), nullable=True),
    sa.Column('label', sa.Integer(), nullable=False),
    sa.Column('words', sa.Text(), nullable=False),
    sa.Column('factual', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['annotation_sentence_id'], ['test_annotation_sentences.id'], ),
    sa.ForeignKeyConstraint(['sentence_group_id'], ['test_survey_groups.id'], ),
    sa.ForeignKeyConstraint(['survey_record_id'], ['survey_record.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.alter_column('user_pool', 'survey_record_id',
               existing_type=mysql.VARCHAR(length=150),
               nullable=False)
    op.drop_constraint('user_pool_ibfk_1', 'user_pool', type_='foreignkey')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_foreign_key('user_pool_ibfk_1', 'user_pool', 'survey_record', ['survey_record_id'], ['id'])
    op.alter_column('user_pool', 'survey_record_id',
               existing_type=mysql.VARCHAR(length=150),
               nullable=True)
    op.drop_table('test_survey_annotations')
    op.drop_table('survey_annotations')
    # ### end Alembic commands ###

"""empty message

Revision ID: <KEY>
Revises: <KEY>8
Create Date: 2020-07-13 20:55:18.016855

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '151f9c8b<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('survey_annotations',
    sa.Column('id', sa.String(length=150), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('survey_record_id', sa.String(length=150), nullable=True),
    sa.Column('annotation_sentence_id', sa.String(length=150), nullable=True),
    sa.Column('sentence_group_id', sa.Integer(), nullable=True),
    sa.Column('label', sa.Integer(), nullable=False),
    sa.Column('words', sa.Text(), nullable=False),
    sa.Column('factual', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['annotation_sentence_id'], ['annotation_sentences.id'], ),
    sa.ForeignKeyConstraint(['sentence_group_id'], ['survey_groups.id'], ),
    sa.ForeignKeyConstraint(['survey_record_id'], ['survey_record.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('test_survey_annotations',
    sa.Column('id', sa.String(length=150), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('survey_record_id', sa.String(length=150), nullable=True),
    sa.Column('annotation_sentence_id', sa.String(length=150), nullable=True),
    sa.Column('sentence_group_id', sa.Integer(), nullable=True),
    sa.Column('label', sa.Integer(), nullable=False),
    sa.Column('words', sa.Text(), nullable=False),
    sa.Column('factual', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['annotation_sentence_id'], ['test_annotation_sentences.id'], ),
    sa.ForeignKeyConstraint(['sentence_group_id'], ['test_survey_groups.id'], ),
    sa.ForeignKeyConstraint(['survey_record_id'], ['survey_record.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.alter_column('user_pool', 'survey_record_id',
               existing_type=mysql.VARCHAR(length=150),
               nullable=False)
    op.drop_constraint('user_pool_ibfk_1', 'user_pool', type_='foreignkey')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_foreign_key('user_pool_ibfk_1', 'user_pool', 'survey_record', ['survey_record_id'], ['id'])
    op.alter_column('user_pool', 'survey_record_id',
               existing_type=mysql.VARCHAR(length=150),
               nullable=True)
    op.drop_table('test_survey_annotations')
    op.drop_table('survey_annotations')
    # ### end Alembic commands ###

empty message  Revision ID: <KEY> Revises: <KEY>8 Create Date: 2020-07-13 20:55:18.016855 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###