Product and paid status of an order can't be NULL

This commit is contained in:
Stijn Seghers 2015-08-18 20:47:49 +02:00
parent f2e2bd2727
commit 47d4300e83

View file

@ -132,8 +132,9 @@ class OrderItem(db.Model):
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
order_id = db.Column(db.Integer, db.ForeignKey('order.id'), nullable=False)
product_id = db.Column(db.Integer, db.ForeignKey('product.id'))
paid = db.Column(db.Boolean, default=False)
product_id = db.Column(db.Integer, db.ForeignKey('product.id'),
nullable=False)
paid = db.Column(db.Boolean, default=False, nullable=False)
extra = db.Column(db.String(254), nullable=True)
name = db.Column(db.String(120))