<reponame>lusi1990/betterlifepsi<filename>psi/migrations/versions/18_8ff0624764b7_.py
"""Set organization id to non-unique to support multiple organization

Revision ID: 8ff0624764b7
Revises: <KEY>
Create Date: 2016-03-24 18:31:33.625868

"""

# revision identifiers, used by Alembic.
revision = '8ff0624764b7'
down_revision = '<KEY>'

from alembic import op


#
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(u'product_external_id_key', 'product', type_='unique')
    op.drop_constraint(u'product_name_key', 'product', type_='unique')
    op.drop_constraint(u'sales_order_external_id_key', 'sales_order', type_='unique')
    op.drop_constraint(u'supplier_external_id_key', 'supplier', type_='unique')
    op.drop_constraint(u'supplier_name_key', 'supplier', type_='unique')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    # TODO.xqliu Change to external_id, organization combine unique constraint
    # TODO.xqliu Change to name, organization combine unique constraint
    op.create_unique_constraint(u'supplier_external_id_key', 'supplier', ['external_id'])
    op.create_unique_constraint(u'supplier_name_key', 'supplier', ['name'])
    op.create_unique_constraint(u'sales_order_external_id_key', 'sales_order', ['external_id'])
    op.create_unique_constraint(u'product_external_id_key', 'product', ['external_id'])
    op.create_unique_constraint(u'product_name_key', 'product', ['name'])
    ### end Alembic commands ###

"""Set organization id to non-unique to support multiple organization

Revision ID: 8ff0624764b7
Revises: <KEY>
Create Date: 2016-03-24 18:31:33.625868

"""

# revision identifiers, used by Alembic.
revision = '8ff0624764b7'
down_revision = '<KEY>'

from alembic import op


#
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(u'product_external_id_key', 'product', type_='unique')
    op.drop_constraint(u'product_name_key', 'product', type_='unique')
    op.drop_constraint(u'sales_order_external_id_key', 'sales_order', type_='unique')
    op.drop_constraint(u'supplier_external_id_key', 'supplier', type_='unique')
    op.drop_constraint(u'supplier_name_key', 'supplier', type_='unique')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    # TODO.xqliu Change to external_id, organization combine unique constraint
    # TODO.xqliu Change to name, organization combine unique constraint
    op.create_unique_constraint(u'supplier_external_id_key', 'supplier', ['external_id'])
    op.create_unique_constraint(u'supplier_name_key', 'supplier', ['name'])
    op.create_unique_constraint(u'sales_order_external_id_key', 'sales_order', ['external_id'])
    op.create_unique_constraint(u'product_external_id_key', 'product', ['external_id'])
    op.create_unique_constraint(u'product_name_key', 'product', ['name'])
    ### end Alembic commands ###
Set organization id to non-unique to support multiple organization  Revision ID: 8ff0624764b7 Revises: <KEY> Create Date: 2016-03-24 18:31:33.625868 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### ### end Alembic commands ### ### commands auto generated by Alembic - please adjust! ### # TODO.xqliu Change to external_id, organization combine unique constraint # TODO.xqliu Change to name, organization combine unique constraint ### end Alembic commands ###