"""Add exit date in trades table

Revision ID: 14f9fd83af6a
Revises: b1f321f39713
Create Date: 2021-05-12 20:16:21.503507

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

# revision identifiers, used by Alembic.
revision = '14f9fd83af6a'
down_revision = 'b1f321f39713'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('trades', sa.Column('exit_date', sa.DateTime(), nullable=True))
    op.alter_column('trades', 'date', nullable=False, new_column_name='entry_date')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('trades', 'entry_date', nullable=False, new_column_name='date')
    op.drop_column('trades', 'exit_date')
    # ### end Alembic commands ###
