Drop all the foreign keys on artifacts table except for the organization_id (#1352)

This commit is contained in:
Shuchang Zheng
2024-12-07 17:34:18 -08:00
committed by GitHub
parent 127f25c663
commit 620b5bfdea
2 changed files with 62 additions and 4 deletions

View File

@@ -162,14 +162,15 @@ class ArtifactModel(Base):
__table_args__ = (
Index("org_task_step_index", "organization_id", "task_id", "step_id"),
Index("org_workflow_run_index", "organization_id", "workflow_run_id"),
Index("org_observer_cruise_index", "organization_id", "observer_cruise_id"),
)
artifact_id = Column(String, primary_key=True, index=True, default=generate_artifact_id)
organization_id = Column(String, ForeignKey("organizations.organization_id"))
workflow_run_id = Column(String, ForeignKey("workflow_runs.workflow_run_id"))
workflow_run_block_id = Column(String, ForeignKey("workflow_run_blocks.workflow_run_block_id"))
observer_cruise_id = Column(String, ForeignKey("observer_cruises.observer_cruise_id"))
observer_thought_id = Column(String, ForeignKey("observer_thoughts.observer_thought_id"))
workflow_run_id = Column(String)
workflow_run_block_id = Column(String)
observer_cruise_id = Column(String)
observer_thought_id = Column(String)
task_id = Column(String, ForeignKey("tasks.task_id"))
step_id = Column(String, ForeignKey("steps.step_id"), index=True)
artifact_type = Column(String)