Skip to content

Commit

Permalink
Make fields nullable again
Browse files Browse the repository at this point in the history
  • Loading branch information
msm-code committed Oct 27, 2024
1 parent 2713b7f commit f399b1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/models/jobagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ class JobAgent(SQLModel, table=True):
id: Union[int, None] = Field(default=None, primary_key=True)
task_in_progress: int

job_id: int = Field(
sa_column=Column(ForeignKey("job.internal_id", ondelete="CASCADE"))
)
job_id: int = Field(foreign_key="job.internal_id", ondelete="CASCADE")
job: "Job" = Relationship(back_populates="agents")

agent_id: int = Field(foreign_key="agentgroup.id")
Expand Down
4 changes: 1 addition & 3 deletions src/models/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@ class Match(SQLModel, table=True):
# A list of yara rules matched to this file
matches: List[str] = Field(sa_column=Column(ARRAY(String)))

job_id: int = Field(
sa_column=Column(ForeignKey("job.internal_id", ondelete="CASCADE"))
)
job_id: int = Field(foreign_key="job.internal_id", ondelete="CASCADE")
job: Job = Relationship(back_populates="matches")

0 comments on commit f399b1c

Please sign in to comment.