# Generated by Django 2.1.7 on 2020-07-20 13:04

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


class Migration(migrations.Migration):

    dependencies = [
        ('company', '0056_auto_20200720_1113'),
    ]

    operations = [
        migrations.CreateModel(
            name='AuthorizedArea',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('adm_ids', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), blank=True, null=True, size=None, verbose_name='授权区域')),
                ('dt_from', models.DateField(blank=True, null=True, verbose_name='授权开始日期')),
                ('dt_to', models.DateField(blank=True, null=True, verbose_name='授权结束日期')),
                ('tm', models.DateField(auto_now_add=True, verbose_name='授权时间')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='authorizedarea_company', to='company.Company', verbose_name='公司')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='authorizedarea_user', to=settings.AUTH_USER_MODEL, verbose_name='授权操作人')),
            ],
            options={
                'verbose_name': '区域授权',
                'verbose_name_plural': '区域授权',
            },
        ),
        migrations.RemoveField(
            model_name='authorizedproducts',
            name='product',
        ),
        migrations.AddField(
            model_name='authorizedproducts',
            name='products',
            field=django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), blank=True, null=True, size=None, verbose_name='授权产品'),
        ),
        migrations.AddField(
            model_name='companycfg',
            name='label_binding',
            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='跨段后绑定表名'),
        ),
        migrations.AlterField(
            model_name='authorizedproducts',
            name='company',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='authorizedproduct_company', to='company.Company', verbose_name='经销商'),
        ),
        migrations.AlterField(
            model_name='authorizedproducts',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='authorizedproduct_user', to=settings.AUTH_USER_MODEL, verbose_name='授权操作人'),
        ),
    ]
