Product and paid status of an order can't be NULL
This commit is contained in:
parent
f2e2bd2727
commit
47d4300e83
1 changed files with 3 additions and 2 deletions
|
@ -132,8 +132,9 @@ class OrderItem(db.Model):
|
||||||
id = db.Column(db.Integer, primary_key=True)
|
id = db.Column(db.Integer, primary_key=True)
|
||||||
user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
|
user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
|
||||||
order_id = db.Column(db.Integer, db.ForeignKey('order.id'), nullable=False)
|
order_id = db.Column(db.Integer, db.ForeignKey('order.id'), nullable=False)
|
||||||
product_id = db.Column(db.Integer, db.ForeignKey('product.id'))
|
product_id = db.Column(db.Integer, db.ForeignKey('product.id'),
|
||||||
paid = db.Column(db.Boolean, default=False)
|
nullable=False)
|
||||||
|
paid = db.Column(db.Boolean, default=False, nullable=False)
|
||||||
extra = db.Column(db.String(254), nullable=True)
|
extra = db.Column(db.String(254), nullable=True)
|
||||||
name = db.Column(db.String(120))
|
name = db.Column(db.String(120))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue