"""Add events-forms M2M table

Revision ID: 7c666157b1bc
Revises: 336dd1cfd7d1
Create Date: 2019-02-26 15:13:16.030155

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '7c666157b1bc'
down_revision = '336dd1cfd7d1'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('events_forms',
    sa.Column('event_id', sa.Integer(), nullable=False),
    sa.Column('form_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['event_id'], ['event.id'], ondelete='CASCADE'),
    sa.ForeignKeyConstraint(['form_id'], ['form.id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('event_id', 'form_id')
    )
    # ### end Alembic commands ###


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