"""add effectivedate to marketdata

Revision ID: e60c73c84358
Revises: d170ea4d3223
Create Date: 2017-11-30 01:36:51.320453

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

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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('MarketData', sa.Column('EffectiveDate', sa.DateTime(), nullable=False))
    op.alter_column('MarketData', 'CreateDate',
               existing_type=postgresql.TIMESTAMP(),
               nullable=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('MarketData', 'CreateDate',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    op.drop_column('MarketData', 'EffectiveDate')
    # ### end Alembic commands ###
