# Generated by Django 2.1.7 on 2020-12-14 12:39

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


class Migration(migrations.Migration):

    dependencies = [
        ('company', '0095_auto_20201214_1239'),
        ('sales', '0093_auto_20201201_2132'),
    ]

    operations = [
        migrations.CreateModel(
            name='BuJiang_Labels',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label_code', models.CharField(blank=True, max_length=50, null=True, verbose_name='标签序号')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否激活')),
                ('is_get', models.BooleanField(default=False, verbose_name='是否领取')),
                ('remark', models.CharField(blank=True, max_length=50, null=True, verbose_name='备注说明')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='步奖时间')),
                ('award', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sales.Award', verbose_name='奖品')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='company.Company', verbose_name='公司名称')),
            ],
            options={
                'verbose_name': '手动步奖',
                'verbose_name_plural': '手动步奖',
            },
        ),
        migrations.CreateModel(
            name='MemberLevel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=20, verbose_name='等级名称')),
                ('level', models.IntegerField(db_index=True, verbose_name='等级')),
                ('photo', models.ImageField(null=True, upload_to=sales.models.memberlever_img_upload, verbose_name='会员图片')),
                ('integral', models.IntegerField(blank=True, null=True, verbose_name='积分')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='MemberCompany', to='company.Company', verbose_name='公司')),
            ],
            options={
                'verbose_name': '会员等级',
                'verbose_name_plural': '会员等级',
            },
        ),
        migrations.CreateModel(
            name='Sms',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('messages', models.CharField(blank=True, max_length=100, null=True, verbose_name='短信内容')),
                ('phone', models.CharField(blank=True, db_index=True, max_length=20, null=True, verbose_name='电话号码')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, null=True, verbose_name='日期')),
                ('tm', models.DateTimeField(auto_now_add=True, null=True, verbose_name='时间')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sms_company', to='company.Company', verbose_name='公司名称')),
            ],
            options={
                'verbose_name': '短信记录',
                'verbose_name_plural': '短信记录',
            },
        ),
        migrations.AddField(
            model_name='member',
            name='exps',
            field=models.IntegerField(blank=True, db_index=True, default=0, null=True, verbose_name='经验'),
        ),
        migrations.AlterField(
            model_name='member',
            name='dt',
            field=models.DateField(auto_now_add=True, db_index=True, null=True, verbose_name='日期'),
        ),
        migrations.AlterField(
            model_name='member',
            name='tm',
            field=models.DateTimeField(auto_now_add=True, null=True, verbose_name='时间'),
        ),
        migrations.RemoveField(
            model_name='member',
            name='age',
        ),
        migrations.AddField(
            model_name='member',
            name='member_level',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='member_level', to='sales.MemberLevel', verbose_name='会员等级'),
        ),
        migrations.AlterUniqueTogether(
            name='member',
            unique_together={('company', 'phone')},
        ),
        migrations.AlterUniqueTogether(
            name='memberlevel',
            unique_together={('company', 'name'), ('company', 'level')},
        ),
    ]
