# Generated by Django 3.2.22 on 2023-11-15 02:17

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("NEMO", "0054_documents_update_max_length"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="PublicationMetadata",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                (
                    "creation_time",
                    models.DateTimeField(
                        auto_now_add=True, help_text="The date and time when the publication metadata was created."
                    ),
                ),
                (
                    "doi",
                    models.CharField(
                        help_text="Digital Object Identifier (DOI) of the publication.", max_length=255, unique=True
                    ),
                ),
                ("title", models.CharField(help_text="Title of the publication.", max_length=255)),
                ("journal", models.CharField(help_text="Journal where the publication is published.", max_length=255)),
                ("bibtex", models.TextField(blank=True, help_text="Publication bibtex metadata.", null=True)),
                ("year", models.PositiveIntegerField(help_text="Publication year.")),
                (
                    "creator",
                    models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="PublicationData",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                (
                    "creation_time",
                    models.DateTimeField(
                        auto_now_add=True, help_text="The date and time when the publication data was created."
                    ),
                ),
                (
                    "authors",
                    models.ManyToManyField(
                        blank=True, help_text="Authors of the publication.", to=settings.AUTH_USER_MODEL
                    ),
                ),
                (
                    "creator",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="publication_data_creator",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "metadata",
                    models.ForeignKey(
                        help_text="The metadata of the publication",
                        on_delete=django.db.models.deletion.CASCADE,
                        to="NEMO_publications.publicationmetadata",
                    ),
                ),
                (
                    "projects",
                    models.ManyToManyField(
                        blank=True, help_text="Projects involved in the publication.", to="NEMO.Project"
                    ),
                ),
                (
                    "tools",
                    models.ManyToManyField(blank=True, help_text="Tools involved in the publication.", to="NEMO.Tool"),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
    ]
