# Generated by Django 3.2.19 on 2023-05-30 18:00

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("NEMO", "0042_version_4_3_0"),
    ]

    operations = [
        migrations.CreateModel(
            name="ChemicalRequest",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("date", models.DateTimeField(auto_now_add=True)),
                ("chemical_name", models.CharField(max_length=200)),
                ("cas", models.CharField(max_length=100)),
                ("container", models.CharField(max_length=100)),
                ("sds_link", models.URLField()),
                ("flammable", models.BooleanField()),
                ("corrosive", models.BooleanField()),
                ("reactive", models.BooleanField()),
                ("temp_sensitive", models.BooleanField()),
                ("stability", models.CharField(max_length=500)),
                ("incompatibilities", models.CharField(max_length=500)),
                ("health_hazards", models.CharField(max_length=500)),
                ("exposure_routes", models.CharField(max_length=500)),
                ("exposure_controls", models.CharField(max_length=500)),
                ("procedure", models.TextField()),
                ("hazardous_waste", models.BooleanField()),
                ("waste_disposal", models.TextField()),
                ("approved", models.IntegerField(choices=[(0, "Pending"), (1, "Approved"), (2, "Denied")], default=0)),
                ("approval_comments", models.TextField(blank=True, null=True)),
                (
                    "approver",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="chemical_approver",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "requester",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="chemical_requester",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "Chemical Requests",
                "ordering": ["-date"],
            },
        ),
        migrations.CreateModel(
            name="UserChemical",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("label_id", models.PositiveIntegerField(unique=True)),
                ("chemical_name", models.CharField(max_length=200)),
                ("sds_link", models.URLField(blank=True, null=True)),
                ("in_date", models.DateField()),
                ("expiration", models.DateField()),
                ("location", models.CharField(max_length=100)),
                ("owner", models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
                (
                    "request",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="NEMO_user_chemicals.chemicalrequest",
                    ),
                ),
            ],
            options={
                "ordering": ["-expiration"],
            },
        ),
    ]
