"""empty message

Revision ID: f1a1ff513a57
Revises: <PASSWORD>
Create Date: 2019-04-30 14:33:21.630408

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'f<PASSWORD>'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('discussions_votes',
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('discussion_id', sa.Integer(), nullable=False),
    sa.Column('vote', sa.Boolean(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=False),
    sa.ForeignKeyConstraint(['discussion_id'], ['discussions.id'], name='discussions_votes__discussion__fk', ondelete='CASCADE'),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], name='discussions_votes__user__fk'),
    sa.PrimaryKeyConstraint('user_id', 'discussion_id')
    )
    # ### end Alembic commands ###


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