"""Add column low_moment_price to Trades

Revision ID: 7add5d2cc147
Revises: bce1234f965c
Create Date: 2021-02-12 17:34:31.548088

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '7add5d2cc147'
down_revision = '7d42c6c69b3a'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('trades', sa.Column('low_moment_price', sa.Numeric(), nullable=True))
    op.execute("UPDATE trades SET low_moment_price = 0")
    op.alter_column('trades', 'low_moment_price', nullable=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('trades', 'low_moment_price')
    # ### end Alembic commands ###