"""empty message

Revision ID: cd8ee9c86836
Revises: 38ebb778de24
Create Date: 2021-03-05 02:17:18.607955

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = 'cd8ee9c86836'
down_revision = '38ebb778de24'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    # op.drop_table('history')
    # op.add_column('entry', sa.Column('simulation_succesful', sa.Boolean(), nullable=True))
    # op.add_column('entry', sa.Column('user_id', sa.Integer(), nullable=True))
    # op.drop_constraint('entry_history_id_fkey', 'entry', type_='foreignkey')
    # op.create_foreign_key(None, 'entry', 'auth_user', ['user_id'], ['id'])
    # op.drop_column('entry', 'history_id')
    # ### end Alembic commands ###
    pass

def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('entry', sa.Column('history_id', sa.INTEGER(), autoincrement=False, nullable=True))
    op.drop_constraint(None, 'entry', type_='foreignkey')
    op.create_foreign_key('entry_history_id_fkey', 'entry', 'history', ['history_id'], ['id'])
    op.drop_column('entry', 'user_id')
    op.drop_column('entry', 'simulation_succesful')
    op.create_table('history',
    sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('date_created', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
    sa.Column('date_modified', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
    sa.Column('name', sa.VARCHAR(length=128), autoincrement=False, nullable=False),
    sa.Column('type', sa.VARCHAR(length=128), autoincrement=False, nullable=False),
    sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['auth_user.id'], name='history_user_id_fkey'),
    sa.PrimaryKeyConstraint('id', name='history_pkey')
    )
    # ### end Alembic commands ###
