"""doc history

Revision ID: 21e44ddad300
Revises: 740fe74d0fb2
Create Date: 2022-05-04 09:29:42.987600

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '21e44ddad300'
down_revision = '740fe74d0fb2'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('cmf_document_history', sa.Column('approved_by_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_document_history_approved_by_id'), 'cmf_document_history', ['approved_by_id'], unique=False)
    op.create_foreign_key(None, 'cmf_document_history', 'cmf_person', ['approved_by_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'cmf_document_history', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_document_history_approved_by_id'), table_name='cmf_document_history')
    op.drop_column('cmf_document_history', 'approved_by_id')
    # ### end Alembic commands ###
