"""Add column position_scalping_mode_end_date to QuantfuryPositions

Revision ID: b00218e08a53
Revises: 6bfefffc7e71
Create Date: 2022-06-24 17:46:56.842826

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

# revision identifiers, used by Alembic.
revision = 'b00218e08a53'
down_revision = '6bfefffc7e71'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('quantfury_orders', 'order_type',
               existing_type=postgresql.ENUM('stop_order', 'target_order', 'limit_order', name='quantfuryordertype'),
               nullable=True)
    op.add_column('quantfury_positions', sa.Column('position_scalping_mode_end_date', sa.DateTime(), nullable=True))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('quantfury_positions', 'position_scalping_mode_end_date')
    op.alter_column('quantfury_orders', 'order_type',
               existing_type=postgresql.ENUM('stop_order', 'target_order', 'limit_order', name='quantfuryordertype'),
               nullable=False)
    # ### end Alembic commands ###
