"""person views

Revision ID: 71413e6132b7
Revises: 14ed03c84589
Create Date: 2022-02-15 11:07:07.049091

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '71413e6132b7'
down_revision = '14ed03c84589'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('cmf_person_view',
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=False),
    sa.Column('person_id', sa.String(length=64), nullable=False),
    sa.Column('obj_id', sa.String(length=64), nullable=False),
    sa.ForeignKeyConstraint(['person_id'], ['cmf_person.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_person_view_cmf_created_at'), 'cmf_person_view', ['cmf_created_at'], unique=False)
    op.create_index(op.f('ix_cmf_person_view_obj_id'), 'cmf_person_view', ['obj_id'], unique=False)
    op.create_index(op.f('ix_cmf_person_view_person_id'), 'cmf_person_view', ['person_id'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_cmf_person_view_person_id'), table_name='cmf_person_view')
    op.drop_index(op.f('ix_cmf_person_view_obj_id'), table_name='cmf_person_view')
    op.drop_index(op.f('ix_cmf_person_view_cmf_created_at'), table_name='cmf_person_view')
    op.drop_table('cmf_person_view')
    # ### end Alembic commands ###
