Fix Product model
Change-Id: I1a3d828fda6e8d3c8471a22ce2317a744a5543ac
This commit is contained in:
parent
5b4573c559
commit
02af5a27d6
@ -432,8 +432,6 @@ def delete_organization(organization_id):
|
||||
def add_product(product_info, creator):
|
||||
"""Add product."""
|
||||
product = models.Product()
|
||||
_id = six.text_type(uuid.uuid4())
|
||||
product.id = _id
|
||||
product.type = product_info['type']
|
||||
product.product_type = product_info['product_type']
|
||||
product.product_id = product_info['product_id']
|
||||
|
@ -223,7 +223,8 @@ class Product(BASE, RefStackBase): # pragma: no cover
|
||||
|
||||
__tablename__ = 'product'
|
||||
|
||||
id = sa.Column(sa.Integer(), primary_key=True)
|
||||
id = sa.Column(sa.String(36), primary_key=True,
|
||||
default=lambda: six.text_type(uuid.uuid4()))
|
||||
product_id = sa.Column(sa.String(36), nullable=False)
|
||||
name = sa.Column(sa.String(80), nullable=False)
|
||||
description = sa.Column(sa.Text())
|
||||
|
Loading…
x
Reference in New Issue
Block a user