"""empty message

Revision ID: 10de698e2461
Revises: 4e01bd72bb4a
Create Date: 2015-12-09 13:40:06.930624

"""

# revision identifiers, used by Alembic.
revision = '10de698e2461'
down_revision = '4e01bd72bb4a'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_unique_constraint(None, 'roles', ['name'])
    op.create_unique_constraint(None, 'tags', ['tag'])
    op.add_column('unvotes', sa.Column('id', sa.Integer(), nullable=False))
    op.alter_column('unvotes', 'answer_id',
               existing_type=sa.INTEGER(),
               nullable=True)
    op.alter_column('unvotes', 'user_id',
               existing_type=sa.INTEGER(),
               nullable=True)
    op.add_column('votes', sa.Column('id', sa.Integer(), nullable=False))
    op.alter_column('votes', 'answer_id',
               existing_type=sa.INTEGER(),
               nullable=True)
    op.alter_column('votes', 'user_id',
               existing_type=sa.INTEGER(),
               nullable=True)
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('votes', 'user_id',
               existing_type=sa.INTEGER(),
               nullable=False)
    op.alter_column('votes', 'answer_id',
               existing_type=sa.INTEGER(),
               nullable=False)
    op.drop_column('votes', 'id')
    op.alter_column('unvotes', 'user_id',
               existing_type=sa.INTEGER(),
               nullable=False)
    op.alter_column('unvotes', 'answer_id',
               existing_type=sa.INTEGER(),
               nullable=False)
    op.drop_column('unvotes', 'id')
    op.drop_constraint(None, 'tags')
    op.drop_constraint(None, 'roles')
    ### end Alembic commands ###
