<filename>migrations/versions/6c1ce20ad624_.py<gh_stars>1-10
"""empty message

Revision ID: 6c1ce20ad624
Revises: <KEY>
Create Date: 2021-03-26 09:52:50.733317

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '6c1ce20ad624'
down_revision = '<KEY>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('defendant_phone_verifications',
    sa.Column('defendant_id', sa.Integer(), nullable=False),
    sa.Column('phone_number_verification_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['defendant_id'], ['defendants.id'], ),
    sa.ForeignKeyConstraint(['phone_number_verification_id'], ['phone_number_verifications.id'], ),
    sa.PrimaryKeyConstraint('defendant_id', 'phone_number_verification_id')
    )
    op.drop_column('defendants', 'phone')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('defendants', sa.Column('phone', sa.VARCHAR(length=20), autoincrement=False, nullable=True))
    op.drop_table('defendant_phone_verifications')
    # ### end Alembic commands ###
