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

Commit

Permalink
🚚 Add environment foreign key (#324)
Browse files Browse the repository at this point in the history
* 🚚 Add environment foreign key

* 🍱 Add migration
  • Loading branch information
falexwolf authored Dec 21, 2023
1 parent 44ca40a commit f004c93
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lnschema_core/migrations/0034_run_environment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.5 on 2023-12-19 12:27

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("lnschema_core", "0033_alter_artifact_unique_together_artifact_n_objects_and_more"),
]

operations = [
migrations.AddField(
model_name="run",
name="environment",
field=models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.PROTECT, related_name="environment_of", to="lnschema_core.artifact"),
),
]
5 changes: 5 additions & 0 deletions lnschema_core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,11 @@ class Run(Registry):
# generated for many different runs
report = models.ForeignKey("Artifact", PROTECT, default=None, null=True, related_name="report_of")
"""Report of run, e.g., an html file."""
environment = models.ForeignKey("Artifact", PROTECT, default=None, null=True, related_name="environment_of")
"""Computational environment for the run.
For instance, a `Dockerfile`, a docker image, a `requirements.txt`, an `environment.yml`, etc.
"""
is_consecutive = models.BooleanField(null=True, default=None)
"""Indicates whether code was consecutively executed. Is relevant for notebooks."""
# input_artifacts on File
Expand Down

0 comments on commit f004c93

Please sign in to comment.