From 61999cb511fa570630b74baf768607edc5051bc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Thu, 6 Aug 2020 19:57:16 +0200 Subject: [PATCH] remove nullable from relationship --- src/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models.py b/src/models.py index 260a056..0c92a8f 100644 --- a/src/models.py +++ b/src/models.py @@ -29,11 +29,11 @@ class SensorStatusEnum(enum.Enum): class Device(db.Model): __tablename__ = 'device' id = db.Column(db.Integer, primary_key=True) - sensorid = db.Column(UUID(as_uuid=True), nullable=False) + sensorid = db.Column(UUID(as_uuid=True), nullable=True) status = db.Column(db.Enum(DeviceStatusEnum), nullable=False) url = db.Column(db.String, nullable=False) lastupdate = db.Column(db.TIMESTAMP, nullable=False, server_default=func.now(), onupdate=func.current_timestamp()) - sensors = db.relationship("Sensor", nullable=True) + sensors = db.relationship("Sensor") class Sensor(db.Model):