# Generated by Django 3.0.5 on 2020-07-06 02:48

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('system', '0021_auto_20200616_1722'),
        ('crm', '0005_auto_20200701_1505'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='enterprise',
            name='mailing_address',
        ),
        migrations.RemoveField(
            model_name='enterprise',
            name='mailing_code',
        ),
        migrations.RemoveField(
            model_name='enterprise',
            name='mailing_eaddress',
        ),
        migrations.RemoveField(
            model_name='enterprise',
            name='production_address',
        ),
        migrations.RemoveField(
            model_name='enterprise',
            name='production_eaddress',
        ),
        migrations.RemoveField(
            model_name='enterprise',
            name='production_postcode',
        ),
        migrations.RemoveField(
            model_name='enterprise',
            name='registered_address',
        ),
        migrations.RemoveField(
            model_name='enterprise',
            name='registered_code',
        ),
        migrations.RemoveField(
            model_name='enterprise',
            name='registered_eaddress',
        ),
        migrations.CreateModel(
            name='EnterpriseAddress',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('address', models.CharField(blank=True, max_length=1000, null=True, verbose_name='地址名称')),
                ('eaddress', models.CharField(blank=True, max_length=1000, null=True, verbose_name='地址英文名称')),
                ('code', models.CharField(blank=True, max_length=1000, null=True, verbose_name='地址邮编邮编')),
                ('type', models.CharField(choices=[('2', '注册地址'), ('1', '通信地址'), ('0', '生产地址')], default='生产地址', max_length=50, verbose_name='地址类型')),
                ('country_code', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='enterpriseaddress_country_code', to='system.Dict', verbose_name='国家代码')),
                ('county_code', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='enterpriseaddress_county_code', to='system.Dict', verbose_name='县/区代码')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='enterpriseaddress_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('enterprise', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='enterpriseaddress_enterprise', to='crm.Enterprise', verbose_name='地址属性')),
                ('provinceCode', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='enterpriseaddress_provinceCode', to='system.Dict', verbose_name='省代码')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='enterpriseaddress_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
