# Generated by Django 5.2.3 on 2025-11-07 08:28

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("ichec_django_core", "0001_initial"),
        (
            "marinerg_facility",
            "0004_equipment_created_at_equipment_updated_at_and_more",
        ),
    ]

    operations = [
        migrations.CreateModel(
            name="DatasetTemplate",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(
                        default=django.utils.timezone.now, editable=False
                    ),
                ),
                ("updated_at", models.DateTimeField(default=django.utils.timezone.now)),
                ("title", models.CharField(max_length=250)),
                ("description", models.TextField(blank=True)),
                (
                    "creator",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="ichec_django_core.member",
                    ),
                ),
                (
                    "form",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="ichec_django_core.form",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="Dataset",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(
                        default=django.utils.timezone.now, editable=False
                    ),
                ),
                ("updated_at", models.DateTimeField(default=django.utils.timezone.now)),
                ("title", models.CharField(max_length=250)),
                ("description", models.TextField(blank=True)),
                ("uri", models.CharField(max_length=250, null=True)),
                ("is_public", models.BooleanField(default=True)),
                ("access_instructions", models.TextField(blank=True, null=True)),
                (
                    "creator",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="ichec_django_core.member",
                    ),
                ),
                (
                    "equipment",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="datasets",
                        to="marinerg_facility.equipment",
                    ),
                ),
                (
                    "facility",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="datasets",
                        to="marinerg_facility.facility",
                    ),
                ),
                (
                    "form",
                    models.OneToOneField(
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="ichec_django_core.populatedform",
                    ),
                ),
                (
                    "template",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="datasets",
                        to="marinerg_data_access.datasettemplate",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
    ]
