remove nullable from relationship
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
ea35672455
commit
61999cb511
@ -29,11 +29,11 @@ class SensorStatusEnum(enum.Enum):
|
|||||||
class Device(db.Model):
|
class Device(db.Model):
|
||||||
__tablename__ = 'device'
|
__tablename__ = 'device'
|
||||||
id = db.Column(db.Integer, primary_key=True)
|
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)
|
status = db.Column(db.Enum(DeviceStatusEnum), nullable=False)
|
||||||
url = db.Column(db.String, nullable=False)
|
url = db.Column(db.String, nullable=False)
|
||||||
lastupdate = db.Column(db.TIMESTAMP, nullable=False, server_default=func.now(), onupdate=func.current_timestamp())
|
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):
|
class Sensor(db.Model):
|
||||||
|
Loading…
Reference in New Issue
Block a user