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


class Migration(migrations.Migration):

    dependencies = [
        ('basic_info', '0025_customer_uniq_customer_merchant_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='TransportVehicle',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100, verbose_name='车辆名称')),
                ('license_plate', models.CharField(max_length=20, verbose_name='车牌号码')),
                ('merchant', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='transport_vehicles', to='basic_info.merchant', verbose_name='所属商户')),
            ],
            options={
                'verbose_name': '运输车辆',
                'verbose_name_plural': '运输车辆',
                'unique_together': {('merchant', 'license_plate')},
            },
        ),
        migrations.CreateModel(
            name='TransportVehicleMaterialCapacity',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('material_name', models.CharField(max_length=100, verbose_name='物料名')),
                ('capacity', models.PositiveIntegerField(verbose_name='容量（条）')),
                ('merchant', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='transport_vehicle_material_capacities', to='basic_info.merchant', verbose_name='所属商户')),
                ('transport_vehicle', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='material_capacities', to='basic_info.transportvehicle', verbose_name='运输车辆')),
            ],
            options={
                'verbose_name': '运输车辆物料容量',
                'verbose_name_plural': '运输车辆物料容量',
                'unique_together': {('transport_vehicle', 'material_name')},
            },
        ),
    ]
