# Generated by Django 3.1.4 on 2022-07-07 16:07

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


class Migration(migrations.Migration):

    dependencies = [
        ('product', '0034_product_shelf_life'),
        ('company', '0300_user_roles'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('sales', '0287_auto_20220707_1509'),
    ]

    operations = [
        migrations.CreateModel(
            name='CouponScan',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('val', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, verbose_name='金额/点值')),
                ('label_code', models.CharField(db_index=True, max_length=20, verbose_name='标签号码')),
                ('label_pkg', models.SmallIntegerField(blank=True, db_index=True, null=True, verbose_name='标签类型')),
                ('label_id', models.BigIntegerField(blank=True, db_index=True, null=True, verbose_name='标签ID')),
                ('label_pk_id', models.BigIntegerField(blank=True, db_index=True, null=True, verbose_name='主箱标ID')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('activity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='coupounbatch_activity', to='sales.activities', verbose_name='所属活动')),
                ('ancestor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='coupondetails_ancestor', to='company.company', verbose_name='所属企业')),
                ('award', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='coupounbatch_award', to='sales.activityawards', verbose_name='奖项')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='coupondetails_company', to='company.company', verbose_name='扫码单位')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='coupondetails_product', to='product.product', verbose_name='产品')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='coupounbatch_user', to=settings.AUTH_USER_MODEL, verbose_name='操作人')),
            ],
            options={
                'verbose_name': '终端活动扫码明细',
                'verbose_name_plural': '终端活动扫码明细',
                'unique_together': {('ancestor', 'label_code')},
            },
        ),
        migrations.AlterUniqueTogether(
            name='coupondetails',
            unique_together=None,
        ),
        migrations.RemoveField(
            model_name='coupondetails',
            name='ancestor',
        ),
        migrations.RemoveField(
            model_name='coupondetails',
            name='batch',
        ),
        migrations.RemoveField(
            model_name='coupondetails',
            name='company',
        ),
        migrations.RemoveField(
            model_name='coupondetails',
            name='product',
        ),
        migrations.DeleteModel(
            name='CouponBatch',
        ),
        migrations.DeleteModel(
            name='CouponDetails',
        ),
    ]
