# Generated by Django 3.1.4 on 2023-06-12 16:12

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


class Migration(migrations.Migration):

    dependencies = [
        ('company', '0325_companycfg_channel_redeem'),
        ('product', '0040_series_banner'),
        ('collection', '0003_collector_phone'),
    ]

    operations = [
        migrations.CreateModel(
            name='Binding',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label_code', models.CharField(db_index=True, max_length=20, verbose_name='标签号码')),
                ('nfc_code', models.CharField(blank=True, db_index=True, max_length=30, null=True, unique=True, verbose_name='NFC编码')),
                ('artical_code', models.CharField(blank=True, max_length=30, null=True, verbose_name='藏品编码')),
                ('label_pkg', models.SmallIntegerField(choices=[(3, '箱'), (2, '盒'), (1, '瓶')], db_index=True, default=2, verbose_name='标签类型')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('artical', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='binding_artical', to='collection.artical', verbose_name='藏品')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='binding_ompany', to='company.company', verbose_name='所属企业')),
                ('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='binding_product', to='product.product', verbose_name='产品名称')),
            ],
            options={
                'verbose_name': '产品标签/NFC数据绑定',
                'verbose_name_plural': '产品标签/NFC数据绑定',
                'unique_together': {('company', 'artical_code')},
            },
        ),
    ]
