Final fixes before generating migration

This commit is contained in:
Midgard 2020-01-26 16:25:59 +01:00
parent d5bb14d3a5
commit 6d7baa31ea
Signed by: midgard
GPG key ID: 511C112F1331BBB4
2 changed files with 4 additions and 2 deletions

View file

@ -18,9 +18,11 @@ class OrderItem(db.Model):
paid = db.Column( paid = db.Column(
db.Boolean, default=False, nullable=False db.Boolean, default=False, nullable=False
) )
comment = db.Column(db.String(254), nullable=True) comment = db.Column(db.Text(), nullable=True)
hlds_data_version = db.Column(db.String(40), nullable=True) hlds_data_version = db.Column(db.String(40), nullable=True)
choices = db.relationship("OrderItemChoice", backref="order_item", lazy="dynamic")
def configure(self, user: User, order: Order) -> None: def configure(self, user: User, order: Order) -> None:
"Configure the OrderItem" "Configure the OrderItem"
# pylint: disable=W0201 # pylint: disable=W0201

View file

@ -7,7 +7,7 @@ from .orderitem import OrderItem
class OrderItemChoice(db.Model): class OrderItemChoice(db.Model):
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
choice_id = db.Column(db.String(64), nullable=True) choice_id = db.Column(db.String(64), nullable=True)
order_item_id = db.Column(db.Integer, db.ForeignKey("orderitem.id"), nullable=False) order_item_id = db.Column(db.Integer, db.ForeignKey("order_item.id"), nullable=False)
kind = db.Column(db.String(1), nullable=False) kind = db.Column(db.String(1), nullable=False)
name = db.Column(db.String(120), nullable=True) name = db.Column(db.String(120), nullable=True)
value = db.Column(db.String(120), nullable=True) value = db.Column(db.String(120), nullable=True)