# Generated by Django 3.1.4 on 2021-01-29 10:16

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


class Migration(migrations.Migration):

    dependencies = [
        ('company', '0138_user_brand_ids'),
        ('sales', '0143_consumerwinner_tm_used'),
    ]

    operations = [
        migrations.CreateModel(
            name='ActivityRebate_Relations',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tm', models.DateTimeField(auto_now_add=True, null=True, verbose_name='关系创建时间')),
                ('activity', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='ActivityRebateRelations_activity', to='sales.activities', verbose_name='返利活动')),
                ('company', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ActivityRebateRelations_company', to='company.company', verbose_name='公司名称')),
                ('consumer', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='ActivityRebate_Relations_consumer', to='sales.consumeraccount', verbose_name='用户')),
                ('parent', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='ActivityRebate_Relations_parent', to='sales.consumeraccount', verbose_name='父级用户')),
            ],
            options={
                'verbose_name': '活动返利用户关系',
                'verbose_name_plural': '返利活动用户关系',
            },
        ),
        migrations.CreateModel(
            name='ActivityRebate_BonusRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('labelcode', models.CharField(max_length=20, verbose_name='标签号码')),
                ('operation', models.IntegerField(verbose_name='操作类型')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='金额')),
                ('tm', models.DateTimeField(auto_now_add=True, null=True, verbose_name='时间')),
                ('remark', models.CharField(blank=True, max_length=50, null=True, verbose_name='备注')),
                ('activity', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='ActivityRebate_BonusRecord_activity', to='sales.activities', verbose_name='返利活动')),
                ('company_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='AActivityRebate_BonusRecord_company', to='company.company', verbose_name='公司')),
                ('consumer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ActivityRebate_BonusRecord_consumer', to='sales.consumeraccount', verbose_name='用户')),
            ],
            options={
                'verbose_name': '活动返利记录',
                'verbose_name_plural': '活动返利记录',
            },
        ),
    ]
