"""op.create_table relation_cache

Revision ID: e7d6deb3830f
Revises: b5cd0882d747
Create Date: 2021-04-15 23:21:57.463357

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'e7d6deb3830f'
down_revision = 'b5cd0882d747'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('relation_cache',
    sa.Column('child_code', sa.TEXT(), nullable=True),
    sa.Column('child_field', sa.TEXT(), nullable=True),
    sa.Column('child_id', sa.String(length=64), nullable=True),
    sa.Column('child_model', sa.TEXT(), nullable=True),
    sa.Column('child_name', sa.TEXT(), nullable=True),
    sa.Column('depth', sa.Integer(), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('parent_code', sa.TEXT(), nullable=True),
    sa.Column('parent_field', sa.TEXT(), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('parent_model', sa.TEXT(), nullable=True),
    sa.Column('parent_name', sa.TEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_relation_cache_child_id'), 'relation_cache', ['child_id'], unique=False)
    op.create_index(op.f('ix_relation_cache_parent_id'), 'relation_cache', ['parent_id'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_relation_cache_parent_id'), table_name='relation_cache')
    op.drop_index(op.f('ix_relation_cache_child_id'), table_name='relation_cache')
    op.drop_table('relation_cache')
    # ### end Alembic commands ###
