Add Product.case_pack column.
				
					
				
			This commit is contained in:
		
							parent
							
								
									80f1605f02
								
							
						
					
					
						commit
						f08506765d
					
				
					 3 changed files with 36 additions and 0 deletions
				
			
		| 
						 | 
					@ -0,0 +1,31 @@
 | 
				
			||||||
 | 
					# -*- coding: utf-8 -*-
 | 
				
			||||||
 | 
					"""add product.case_pack
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Revision ID: 268ff6454410
 | 
				
			||||||
 | 
					Revises: 571c070b7080
 | 
				
			||||||
 | 
					Create Date: 2015-02-11 19:59:50.344482
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from __future__ import unicode_literals
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# revision identifiers, used by Alembic.
 | 
				
			||||||
 | 
					revision = '268ff6454410'
 | 
				
			||||||
 | 
					down_revision = u'571c070b7080'
 | 
				
			||||||
 | 
					branch_labels = None
 | 
				
			||||||
 | 
					depends_on = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from alembic import op
 | 
				
			||||||
 | 
					import sqlalchemy as sa
 | 
				
			||||||
 | 
					import rattail.db.types
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def upgrade():
 | 
				
			||||||
 | 
					    op.add_column('product', sa.Column('case_pack', sa.Integer(), nullable=True))
 | 
				
			||||||
 | 
					    op.add_column('product_version', sa.Column('case_pack', sa.Integer(), nullable=True))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def downgrade():
 | 
				
			||||||
 | 
					    op.drop_column('product_version', 'case_pack')
 | 
				
			||||||
 | 
					    op.drop_column('product', 'case_pack')
 | 
				
			||||||
| 
						 | 
					@ -962,6 +962,7 @@ class ProductImporter(Importer):
 | 
				
			||||||
        'report_code_uuid',
 | 
					        'report_code_uuid',
 | 
				
			||||||
        'brand_uuid',
 | 
					        'brand_uuid',
 | 
				
			||||||
        'unit_of_measure',
 | 
					        'unit_of_measure',
 | 
				
			||||||
 | 
					        'case_pack',
 | 
				
			||||||
        'not_for_sale',
 | 
					        'not_for_sale',
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
    regular_price_fields = [
 | 
					    regular_price_fields = [
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -88,6 +88,10 @@ UUID of the product's report code, if any.
 | 
				
			||||||
    size = sa.Column(sa.String(length=30))
 | 
					    size = sa.Column(sa.String(length=30))
 | 
				
			||||||
    unit_of_measure = sa.Column(sa.String(length=4))
 | 
					    unit_of_measure = sa.Column(sa.String(length=4))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    case_pack = sa.Column(sa.Integer(), nullable=True, doc="""
 | 
				
			||||||
 | 
					Pack size for the product, i.e. how many units are in a case.
 | 
				
			||||||
 | 
					""")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    not_for_sale = sa.Column(sa.Boolean(), nullable=False, default=False, doc="""
 | 
					    not_for_sale = sa.Column(sa.Boolean(), nullable=False, default=False, doc="""
 | 
				
			||||||
Flag to indicate items which are not available for sale.
 | 
					Flag to indicate items which are not available for sale.
 | 
				
			||||||
""")
 | 
					""")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue