Add Product.deleted
column.
This commit is contained in:
parent
e7e910e1ef
commit
362c503fff
rattail/db
|
@ -0,0 +1,38 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""add product.deleted
|
||||
|
||||
Revision ID: 1513dc6d6ca7
|
||||
Revises: 47d30c955111
|
||||
Create Date: 2015-02-10 22:17:45.367561
|
||||
|
||||
"""
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '1513dc6d6ca7'
|
||||
down_revision = u'47d30c955111'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import rattail.db.types
|
||||
|
||||
|
||||
|
||||
def upgrade():
|
||||
|
||||
# add product.deleted
|
||||
op.add_column('product', sa.Column('deleted', sa.Boolean(), nullable=True))
|
||||
product = sa.sql.table('product', sa.sql.column('deleted'))
|
||||
op.execute(product.update().values({'deleted': False}))
|
||||
op.alter_column('product', 'deleted', nullable=False)
|
||||
op.add_column('product_version', sa.Column('deleted', sa.Boolean(), nullable=True))
|
||||
|
||||
|
||||
def downgrade():
|
||||
|
||||
# drop product.deleted
|
||||
op.drop_column('product_version', 'deleted')
|
||||
op.drop_column('product', 'deleted')
|
|
@ -90,6 +90,12 @@ UUID of the product's report code, if any.
|
|||
|
||||
not_for_sale = sa.Column(sa.Boolean(), nullable=False, default=False, doc="""
|
||||
Flag to indicate items which are not available for sale.
|
||||
""")
|
||||
|
||||
deleted = sa.Column(sa.Boolean(), nullable=False, default=False, doc="""
|
||||
Flag to indicate items which have been deleted. Obviously this is implies
|
||||
"false" deletion, where the record is actually kept on file. Whether or not
|
||||
you use this is up to you.
|
||||
""")
|
||||
|
||||
regular_price_uuid = sa.Column(sa.String(length=32))
|
||||
|
|
Loading…
Reference in a new issue