# Generated by Django 3.1.4 on 2021-11-26 19:54

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


class Migration(migrations.Migration):

    dependencies = [
        ('company', '0259_channel'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='channel',
            name='company',
        ),
        migrations.RemoveField(
            model_name='channel',
            name='description',
        ),
        migrations.RemoveField(
            model_name='channel',
            name='level',
        ),
        migrations.AddField(
            model_name='channel',
            name='ancestor',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='channel_company', to='company.company', verbose_name='企业名称'),
        ),
        migrations.AddField(
            model_name='company',
            name='channel',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='company.channel', verbose_name='渠道'),
        ),
        migrations.AlterField(
            model_name='channel',
            name='name',
            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='渠道名称'),
        ),
        migrations.CreateModel(
            name='Channel_Level',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='等级名称')),
                ('level', models.SmallIntegerField(blank=True, null=True, verbose_name='等级')),
                ('description', models.CharField(max_length=50, verbose_name='等级描述')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注')),
                ('ancestor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='channellevel_company', to='company.company', verbose_name='企业名称')),
            ],
            options={
                'verbose_name': '客户渠道等级',
                'verbose_name_plural': '客户渠道等级',
            },
        ),
        migrations.AddField(
            model_name='company',
            name='channel_level',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='company.channel_level', verbose_name='渠道等级'),
        ),
    ]
