# Generated by Django 2.1.7 on 2020-07-06 16:39

import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('company', '0045_auto_20200703_1702'),
        ('product', '0009_product_photo'),
        ('sales', '0027_auto_20200706_1635'),
    ]

    operations = [
        migrations.CreateModel(
            name='LabelScan',
            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='标签号码')),
                ('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')),
                ('province', models.CharField(blank=True, max_length=100, null=True, verbose_name='省份')),
                ('city', models.CharField(blank=True, max_length=50, null=True, verbose_name='城市')),
                ('address', models.CharField(blank=True, max_length=200, null=True, verbose_name='详细地址')),
                ('pos_permission', models.BooleanField(verbose_name='是否允许获取地理位置')),
                ('lng_lat', django.contrib.postgres.fields.ArrayField(base_field=models.DecimalField(blank=True, decimal_places=8, max_digits=12), blank=True, null=True, size=None)),
                ('amd_id1', models.IntegerField(blank=True, null=True, verbose_name='GIS adm_id1')),
                ('amd_id2', models.IntegerField(blank=True, null=True, verbose_name='GIS adm_id2')),
                ('amd_id3', models.IntegerField(blank=True, null=True, verbose_name='GIS adm_id3')),
                ('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='备注说明')),
                ('activity', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='labelscan_activity', to='sales.Activities', verbose_name='活动名称')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='labelscan_company', to='company.Company', verbose_name='公司名称')),
                ('consumer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='labelscan_consumer', to='sales.ConsumerAccount', verbose_name='消费者帐号')),
                ('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='customerscan_product', to='product.Product', verbose_name='产品名称')),
            ],
            options={
                'verbose_name': '消费者扫码记录',
                'verbose_name_plural': '消费者扫码记录',
            },
        ),
    ]
