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


class Migration(migrations.Migration):

    dependencies = [
        ('shipment', '0023_shipmentdelivery_shipment_order_ids'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='ShipmentDeliveryPhoto',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('photo', models.ImageField(upload_to='shipment_delivery_photos/', verbose_name='送达照片')),
                ('remark', models.CharField(blank=True, default='', max_length=200, verbose_name='备注')),
                ('created_by', models.ForeignKey(null=True, on_delete=models.SET_NULL, related_name='created_shipment_delivery_photos', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('delivery', models.ForeignKey(on_delete=models.CASCADE, related_name='photos', to='shipment.shipmentdelivery', verbose_name='送货单')),
                ('shipment', models.ForeignKey(on_delete=models.CASCADE, related_name='delivery_photos', to='shipment.shipment', verbose_name='出货单')),
            ],
            options={
                'verbose_name': '送达照片',
                'verbose_name_plural': '送达照片',
                'db_table': 'shipment_delivery_photo',
                'ordering': ['-created_at', '-id'],
            },
        ),
        migrations.AddIndex(
            model_name='shipmentdeliveryphoto',
            index=models.Index(fields=['shipment', 'delivery'], name='shipment_de_shipment_355c1f_idx'),
        ),
    ]