Skip to content

Commit f1166c4

Browse files
committed
Tomography preprpocessing parameters also require compound foreign key
1 parent 5fd9e58 commit f1166c4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/murfey/util/db.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,14 @@ class SelectionStash(SQLModel, table=True): # type: ignore
471471

472472

473473
class TomographyPreprocessingParameters(SQLModel, table=True): # type: ignore
474-
dcg_id: int = Field(primary_key=True, foreign_key="datacollectiongroup.id")
474+
__table_args__ = (
475+
ForeignKeyConstraint(
476+
["dcg_id", "dcg_tag"], ["datacollectiongroup.id", "datacollectiongroup.tag"]
477+
),
478+
)
479+
480+
dcg_id: int = Field(primary_key=True)
481+
dcg_tag: int = Field(primary_key=True)
475482
pixel_size: float
476483
dose_per_frame: float
477484
frame_count: int

0 commit comments

Comments
 (0)