Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
♻️ Fix backward references to artifactcollection
Browse files Browse the repository at this point in the history
  • Loading branch information
falexwolf committed May 18, 2024
1 parent cf54d05 commit 685bea4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class Migration(migrations.Migration):
name="artifact",
field=models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
related_name="+",
related_name="collection_links",
to="lnschema_core.artifact",
),
),
Expand All @@ -119,7 +119,7 @@ class Migration(migrations.Migration):
name="collection",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="+",
related_name="artifact_links",
to="lnschema_core.collection",
),
),
Expand Down
4 changes: 2 additions & 2 deletions lnschema_core/migrations/0050_squashed.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,15 +310,15 @@ class Migration(migrations.Migration):
"artifact",
models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
related_name="+",
related_name="collection_links",
to="lnschema_core.artifact",
),
),
(
"collection",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="+",
related_name="artifact_links",
to="lnschema_core.collection",
),
),
Expand Down
4 changes: 2 additions & 2 deletions lnschema_core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2368,8 +2368,8 @@ class Meta:

class CollectionArtifact(Registry, LinkORM):
id = models.BigAutoField(primary_key=True)
collection = models.ForeignKey(Collection, CASCADE, related_name="+")
artifact = models.ForeignKey(Artifact, PROTECT, related_name="+")
collection = models.ForeignKey(Collection, CASCADE, related_name="artifact_links")
artifact = models.ForeignKey(Artifact, PROTECT, related_name="collection_links")

class Meta:
unique_together = ("collection", "artifact")
Expand Down

0 comments on commit 685bea4

Please sign in to comment.