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 05b2340
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ redis==5.0.8
requests==2.32.2
rq==1.16.2
sniffio==1.3.1
sqlmodel==0.0.11
sqlmodel==0.0.22
starlette==0.38.6
typed-config==2.0.3
types-requests==2.32.0.20240914
Expand Down
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 05b2340

Please sign in to comment.