"""create ws_parser_cache_sync table

Revision ID: 47b1aedb5215
Revises: 0f478e8e3585
Create Date: 2018-08-22 13:52:00.718877

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '47b1aedb5215'
down_revision = '0f478e8e3585'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('ws_parser_cache_sync',
    sa.Column('wspc_page_id', sa.Integer(), nullable=False),
    sa.Column('wspc_rev_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['wspc_page_id'], ['page.page_id'], ondelete='CASCADE', initially='DEFERRED', deferrable=True),
    sa.ForeignKeyConstraint(['wspc_rev_id'], ['revision.rev_id'], ondelete='CASCADE', initially='DEFERRED', deferrable=True),
    sa.PrimaryKeyConstraint('wspc_page_id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('ws_parser_cache_sync')
    # ### end Alembic commands ###
