# Generated by Django 3.1.4 on 2021-07-15 15:41

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


class Migration(migrations.Migration):

    dependencies = [
        ('product', '0016_product_external_series'),
        ('company', '0221_auto_20210715_1359'),
    ]

    operations = [
        migrations.AddField(
            model_name='company',
            name='series',
            field=models.JSONField(blank=True, default=list, null=True, verbose_name='授权品牌'),
        ),
        migrations.AddField(
            model_name='companycfg',
            name='franchise_mgt',
            field=models.SmallIntegerField(blank=True, choices=[(0, '无加盟商管理'), (1, '品牌/系列授权管理'), (2, '产品授权管理')], default=0, verbose_name='加盟店授权管理'),
        ),
        migrations.CreateModel(
            name='Franchise',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ancestor_id', models.IntegerField(verbose_name='所属企业')),
                ('name', models.CharField(max_length=100, verbose_name='分店名称')),
                ('province_gis_id', models.IntegerField(blank=True, null=True, verbose_name='GIS省份ID')),
                ('city_gis_id', models.IntegerField(blank=True, null=True, verbose_name='GIS城市ID')),
                ('county_gis_id', models.IntegerField(blank=True, null=True, verbose_name='GIS县区ID')),
                ('lng_lat', django.contrib.postgres.fields.ArrayField(base_field=models.DecimalField(decimal_places=8, max_digits=12, verbose_name='经纬度'), blank=True, null=True, size=None)),
                ('address', models.CharField(blank=True, max_length=100, null=True, verbose_name='详细地址')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='franchise_company', to='company.company', verbose_name='所属加盟商')),
                ('prdduct', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='product.product', verbose_name='授权产品')),
                ('series', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='franchise_series', to='product.series', verbose_name='授权品牌')),
            ],
            options={
                'verbose_name': '加盟商分店信息',
                'verbose_name_plural': '加盟商分店信息',
            },
        ),
    ]
