"""Remove some Classes

Revision ID: dbb4f294c145
Revises: 
Create Date: 2017-11-04 20:40:39.003931

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('user_roles')
    op.drop_constraint('comments_user_id_fkey', 'comments', type_='foreignkey')
    op.drop_column('comments', 'user_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('comments', sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=True))
    op.create_foreign_key('comments_user_id_fkey', 'comments', 'users', ['user_id'], ['id'])
    op.create_table('user_roles',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('role_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.ForeignKeyConstraint(['role_id'], ['roles.id'], name='user_roles_role_id_fkey', ondelete='CASCADE'),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], name='user_roles_user_id_fkey', ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id', name='user_roles_pkey')
    )
    # ### end Alembic commands ###

cd468d33beb07b2f40cd0b4fe27b5bf0a8baf847
<mask token>


def downgrade():
    op.add_column('comments', sa.Column('user_id', sa.INTEGER(),
        autoincrement=False, nullable=True))
    op.create_foreign_key('comments_user_id_fkey', 'comments', 'users', [
        'user_id'], ['id'])
    op.create_table('user_roles', sa.Column('id', sa.INTEGER(), nullable=
        False), sa.Column('user_id', sa.INTEGER(), autoincrement=False,
        nullable=True), sa.Column('role_id', sa.INTEGER(), autoincrement=
        False, nullable=True), sa.ForeignKeyConstraint(['role_id'], [
        'roles.id'], name='user_roles_role_id_fkey', ondelete='CASCADE'),
        sa.ForeignKeyConstraint(['user_id'], ['users.id'], name=
        'user_roles_user_id_fkey', ondelete='CASCADE'), sa.
        PrimaryKeyConstraint('id', name='user_roles_pkey'))

<mask token>


def upgrade():
    op.drop_table('user_roles')
    op.drop_constraint('comments_user_id_fkey', 'comments', type_='foreignkey')
    op.drop_column('comments', 'user_id')


def downgrade():
    op.add_column('comments', sa.Column('user_id', sa.INTEGER(),
        autoincrement=False, nullable=True))
    op.create_foreign_key('comments_user_id_fkey', 'comments', 'users', [
        'user_id'], ['id'])
    op.create_table('user_roles', sa.Column('id', sa.INTEGER(), nullable=
        False), sa.Column('user_id', sa.INTEGER(), autoincrement=False,
        nullable=True), sa.Column('role_id', sa.INTEGER(), autoincrement=
        False, nullable=True), sa.ForeignKeyConstraint(['role_id'], [
        'roles.id'], name='user_roles_role_id_fkey', ondelete='CASCADE'),
        sa.ForeignKeyConstraint(['user_id'], ['users.id'], name=
        'user_roles_user_id_fkey', ondelete='CASCADE'), sa.
        PrimaryKeyConstraint('id', name='user_roles_pkey'))

<mask token>
revision = 'dbb4f294c145'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    op.drop_table('user_roles')
    op.drop_constraint('comments_user_id_fkey', 'comments', type_='foreignkey')
    op.drop_column('comments', 'user_id')


def downgrade():
    op.add_column('comments', sa.Column('user_id', sa.INTEGER(),
        autoincrement=False, nullable=True))
    op.create_foreign_key('comments_user_id_fkey', 'comments', 'users', [
        'user_id'], ['id'])
    op.create_table('user_roles', sa.Column('id', sa.INTEGER(), nullable=
        False), sa.Column('user_id', sa.INTEGER(), autoincrement=False,
        nullable=True), sa.Column('role_id', sa.INTEGER(), autoincrement=
        False, nullable=True), sa.ForeignKeyConstraint(['role_id'], [
        'roles.id'], name='user_roles_role_id_fkey', ondelete='CASCADE'),
        sa.ForeignKeyConstraint(['user_id'], ['users.id'], name=
        'user_roles_user_id_fkey', ondelete='CASCADE'), sa.
        PrimaryKeyConstraint('id', name='user_roles_pkey'))

<mask token>
from alembic import op
import sqlalchemy as sa
revision = 'dbb4f294c145'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    op.drop_table('user_roles')
    op.drop_constraint('comments_user_id_fkey', 'comments', type_='foreignkey')
    op.drop_column('comments', 'user_id')


def downgrade():
    op.add_column('comments', sa.Column('user_id', sa.INTEGER(),
        autoincrement=False, nullable=True))
    op.create_foreign_key('comments_user_id_fkey', 'comments', 'users', [
        'user_id'], ['id'])
    op.create_table('user_roles', sa.Column('id', sa.INTEGER(), nullable=
        False), sa.Column('user_id', sa.INTEGER(), autoincrement=False,
        nullable=True), sa.Column('role_id', sa.INTEGER(), autoincrement=
        False, nullable=True), sa.ForeignKeyConstraint(['role_id'], [
        'roles.id'], name='user_roles_role_id_fkey', ondelete='CASCADE'),
        sa.ForeignKeyConstraint(['user_id'], ['users.id'], name=
        'user_roles_user_id_fkey', ondelete='CASCADE'), sa.
        PrimaryKeyConstraint('id', name='user_roles_pkey'))

"""Remove some Classes

Revision ID: dbb4f294c145
Revises: 
Create Date: 2017-11-04 20:40:39.003931

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('user_roles')
    op.drop_constraint('comments_user_id_fkey', 'comments', type_='foreignkey')
    op.drop_column('comments', 'user_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('comments', sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=True))
    op.create_foreign_key('comments_user_id_fkey', 'comments', 'users', ['user_id'], ['id'])
    op.create_table('user_roles',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('role_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.ForeignKeyConstraint(['role_id'], ['roles.id'], name='user_roles_role_id_fkey', ondelete='CASCADE'),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], name='user_roles_user_id_fkey', ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id', name='user_roles_pkey')
    )
    # ### end Alembic commands ###
