"""order refactor

Revision ID: 2093179e414b
Revises: 876c88b037d
Create Date: 2015-03-21 21:17:57.092608

"""

# revision identifiers, used by Alembic.
revision = '2093179e414b'
down_revision = '876c88b037d'
branch_labels = None
depends_on = None

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

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('order_details')
    op.add_column('orders', sa.Column('details', postgresql.JSON(), nullable=True))
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('orders', 'details')
    op.create_table('order_details',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('order_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('details', postgresql.JSON(), autoincrement=False, nullable=True),
    sa.ForeignKeyConstraint(['order_id'], [u'orders.id'], name=u'order_details_order_id_fkey'),
    sa.PrimaryKeyConstraint('id', name=u'order_details_pkey')
    )
    ### end Alembic commands ###
