"""use close_date for closed status

Revision ID: 220436d6dcdc
Revises: 8c11642354d1
Create Date: 2016-05-31 08:53:16.714351

"""

# revision identifiers, used by Alembic.
revision = '220436d6dcdc'
down_revision = '8c11642354d1'

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

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('orders', sa.Column('close_date', sa.DateTime(), nullable=True))
    op.add_column('orders', sa.Column('delivery_date', sa.DateTime(), nullable=True))
    op.drop_column('orders', 'closed')
    op.drop_column('orders', 'date')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('orders', sa.Column('date', postgresql.TIMESTAMP(), autoincrement=False, nullable=False))
    op.add_column('orders', sa.Column('closed', sa.BOOLEAN(), server_default=sa.text('true'), autoincrement=False, nullable=False))
    op.drop_column('orders', 'delivery_date')
    op.drop_column('orders', 'close_date')
    ### end Alembic commands ###
