[events] Default jobs to unlocked state

This commit is contained in:
Ferdinand Thiessen 2021-11-22 15:33:18 +01:00
parent 7cac708309
commit 471258c886
1 changed files with 4 additions and 2 deletions

View File

@ -65,8 +65,10 @@ class Job(db.Model, ModelSerializeMixin):
end: Optional[datetime] = db.Column(UtcDateTime)
type: Union[JobType, int] = db.relationship("JobType")
comment: Optional[str] = db.Column(db.String(256))
locked: bool = db.Column(db.Boolean())
services: list[Service] = db.relationship("Service", back_populates="job_")
locked: bool = db.Column(db.Boolean(), default=False, nullable=False)
services: list[Service] = db.relationship(
"Service", back_populates="job_", cascade="save-update, merge, delete, delete-orphan"
)
required_services: float = db.Column(db.Numeric(precision=4, scale=2, asdecimal=False), nullable=False)
event_ = db.relationship("Event", back_populates="jobs")