# Generated by Django 3.2.2 on 2021-08-11 09:47

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("warehouse", "0014_remove_warehouse_company_name"),
        ("vendor", "0001_initial"),
    ]

    operations = [
        migrations.RemoveField(
            model_name="vendor",
            name="warehouse",
        ),
        migrations.AlterField(
            model_name="vendor",
            name="allocation",
            field=models.ManyToManyField(
                related_name="vendor_allocation", to="warehouse.Allocation"
            ),
        ),
        migrations.AlterField(
            model_name="vendor",
            name="user",
            field=models.OneToOneField(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="vendor_user",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.CreateModel(
            name="VendorWarehouse",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "vendor_id",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="vendorware_vendor",
                        to="vendor.vendor",
                    ),
                ),
                (
                    "warehouse",
                    models.OneToOneField(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="vendor_warehouse",
                        to="warehouse.warehouse",
                    ),
                ),
            ],
            options={
                "verbose_name": "VendorWarehouse",
                "verbose_name_plural": "VendorWarehouses",
            },
        ),
    ]
