# Generated by Django 5.2.4 on 2025-09-10 03:24

import uuid

import _socket
import django.db.models.deletion
import django_audit_fields.fields.hostname_modification_field
import django_audit_fields.fields.userfield
import django_audit_fields.fields.uuid_auto_field
import django_revision.revision_field
import simple_history.models
from django.conf import settings
from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):
    dependencies = [
        ("edc_reportable", "0005_historicalnormaldata_auto_created_and_more"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AlterField(
            model_name="gradingdata",
            name="revision",
            field=django_revision.revision_field.RevisionField(
                blank=True,
                editable=False,
                help_text="System field. From git repository (tag:branch:commit), project metadata, project toml, project VERSION, or settings.",
                max_length=75,
                null=True,
                verbose_name="Revision",
            ),
        ),
        migrations.AlterField(
            model_name="gradingexception",
            name="revision",
            field=django_revision.revision_field.RevisionField(
                blank=True,
                editable=False,
                help_text="System field. From git repository (tag:branch:commit), project metadata, project toml, project VERSION, or settings.",
                max_length=75,
                null=True,
                verbose_name="Revision",
            ),
        ),
        migrations.AlterField(
            model_name="historicalgradingdata",
            name="revision",
            field=django_revision.revision_field.RevisionField(
                blank=True,
                editable=False,
                help_text="System field. From git repository (tag:branch:commit), project metadata, project toml, project VERSION, or settings.",
                max_length=75,
                null=True,
                verbose_name="Revision",
            ),
        ),
        migrations.AlterField(
            model_name="historicalnormaldata",
            name="revision",
            field=django_revision.revision_field.RevisionField(
                blank=True,
                editable=False,
                help_text="System field. From git repository (tag:branch:commit), project metadata, project toml, project VERSION, or settings.",
                max_length=75,
                null=True,
                verbose_name="Revision",
            ),
        ),
        migrations.AlterField(
            model_name="normaldata",
            name="revision",
            field=django_revision.revision_field.RevisionField(
                blank=True,
                editable=False,
                help_text="System field. From git repository (tag:branch:commit), project metadata, project toml, project VERSION, or settings.",
                max_length=75,
                null=True,
                verbose_name="Revision",
            ),
        ),
        migrations.AlterField(
            model_name="referencerangecollection",
            name="revision",
            field=django_revision.revision_field.RevisionField(
                blank=True,
                editable=False,
                help_text="System field. From git repository (tag:branch:commit), project metadata, project toml, project VERSION, or settings.",
                max_length=75,
                null=True,
                verbose_name="Revision",
            ),
        ),
        migrations.CreateModel(
            name="HistoricalMolecularWeight",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. From git repository (tag:branch:commit), project metadata, project toml, project VERSION, or settings.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(blank=True, default=django.utils.timezone.now),
                ),
                (
                    "modified",
                    models.DateTimeField(blank=True, default=django.utils.timezone.now),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                        verbose_name="Hostname created",
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                        verbose_name="Hostname modified",
                    ),
                ),
                (
                    "device_created",
                    models.CharField(blank=True, max_length=10, verbose_name="Device created"),
                ),
                (
                    "device_modified",
                    models.CharField(
                        blank=True, max_length=10, verbose_name="Device modified"
                    ),
                ),
                (
                    "locale_created",
                    models.CharField(
                        blank=True,
                        help_text="Auto-updated by Modeladmin",
                        max_length=10,
                        null=True,
                        verbose_name="Locale created",
                    ),
                ),
                (
                    "locale_modified",
                    models.CharField(
                        blank=True,
                        help_text="Auto-updated by Modeladmin",
                        max_length=10,
                        null=True,
                        verbose_name="Locale modified",
                    ),
                ),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        db_index=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                    ),
                ),
                ("label", models.CharField(db_index=True, max_length=25)),
                (
                    "mw",
                    models.FloatField(
                        default=0, help_text="in g/mol", verbose_name="Molecular weight"
                    ),
                ),
                (
                    "history_id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("history_date", models.DateTimeField(db_index=True)),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "historical Molecular weight",
                "verbose_name_plural": "historical Molecular weights",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": ("history_date", "history_id"),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="MolecularWeight",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. From git repository (tag:branch:commit), project metadata, project toml, project VERSION, or settings.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(blank=True, default=django.utils.timezone.now),
                ),
                (
                    "modified",
                    models.DateTimeField(blank=True, default=django.utils.timezone.now),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                        verbose_name="Hostname created",
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                        verbose_name="Hostname modified",
                    ),
                ),
                (
                    "device_created",
                    models.CharField(blank=True, max_length=10, verbose_name="Device created"),
                ),
                (
                    "device_modified",
                    models.CharField(
                        blank=True, max_length=10, verbose_name="Device modified"
                    ),
                ),
                (
                    "locale_created",
                    models.CharField(
                        blank=True,
                        help_text="Auto-updated by Modeladmin",
                        max_length=10,
                        null=True,
                        verbose_name="Locale created",
                    ),
                ),
                (
                    "locale_modified",
                    models.CharField(
                        blank=True,
                        help_text="Auto-updated by Modeladmin",
                        max_length=10,
                        null=True,
                        verbose_name="Locale modified",
                    ),
                ),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("label", models.CharField(max_length=25, unique=True)),
                (
                    "mw",
                    models.FloatField(
                        default=0, help_text="in g/mol", verbose_name="Molecular weight"
                    ),
                ),
            ],
            options={
                "verbose_name": "Molecular weight",
                "verbose_name_plural": "Molecular weights",
                "abstract": False,
                "default_permissions": (
                    "add",
                    "change",
                    "delete",
                    "view",
                    "export",
                    "import",
                ),
                "default_manager_name": "objects",
                "indexes": [
                    models.Index(
                        fields=["modified", "created"],
                        name="edc_reporta_modifie_7e6235_idx",
                    ),
                    models.Index(
                        fields=["user_modified", "user_created"],
                        name="edc_reporta_user_mo_e8f92b_idx",
                    ),
                ],
            },
        ),
    ]
