"""channel call

Revision ID: fe5662b22b0d
Revises: 7d6bb4e89f43
Create Date: 2021-09-07 15:05:11.014916

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'fe5662b22b0d'
down_revision = '7d6bb4e89f43'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('cmf_channel_call', sa.Column('called_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_channel_call_called_id'), 'cmf_channel_call', ['called_id'], unique=False)
    op.add_column('cmf_comment', sa.Column('channel_call_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_comment_channel_call_id'), 'cmf_comment', ['channel_call_id'], unique=True)
    op.create_foreign_key(None, 'cmf_comment', 'cmf_channel_call', ['channel_call_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'cmf_comment', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_comment_channel_call_id'), table_name='cmf_comment')
    op.drop_column('cmf_comment', 'channel_call_id')
    op.drop_index(op.f('ix_cmf_channel_call_called_id'), table_name='cmf_channel_call')
    op.drop_column('cmf_channel_call', 'called_id')
    # ### end Alembic commands ###
