<filename>user/migrations/0003_comment_earning_favour_historycourse_historylecture_notification_order_promotion_promotionbase_rank_.py
# Generated by Django 3.0.3 on 2020-03-07 10:37

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


class Migration(migrations.Migration):

    dependencies = [
        ('course', '0001_initial'),
        ('user', '0002_auto_20200302_1621'),
    ]

    operations = [
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField(blank=True, null=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('status', models.BooleanField(default=True)),
                ('course', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='course.Course', verbose_name='课程')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='user.User')),
            ],
        ),
        migrations.CreateModel(
            name='HistoryCourse',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('study_length', models.IntegerField(default=0)),
                ('study_time', models.DateTimeField(auto_now_add=True)),
                ('course', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='history', to='course.Course', verbose_name='课程')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='history', to='user.User')),
            ],
        ),
        migrations.CreateModel(
            name='SaleData',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('course_classification', models.IntegerField(choices=[(0, '普通课程'), (1, '微课'), (2, 'Demo'), (3, '总量')], verbose_name='课程类型')),
            ],
            options={
                'verbose_name': '销售数据',
            },
        ),
        migrations.CreateModel(
            name='UserData',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_classification', models.IntegerField(choices=[(-1, '所有用户'), (0, '官方账号'), (1, '普通用户')], verbose_name='用户类型')),
            ],
            options={
                'verbose_name': '用户数据',
            },
        ),
        migrations.CreateModel(
            name='WithdrawRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('alipay', models.CharField(max_length=32, null=True, verbose_name='支付宝账号')),
                ('real_name', models.CharField(max_length=32, null=True, verbose_name='真实姓名')),
                ('value', models.DecimalField(decimal_places=2, max_digits=6, verbose_name='提现金额')),
                ('status', models.IntegerField(choices=[(0, '提现成功'), (1, '审核中'), (2, '提现失败')], default=1, verbose_name='提现状态')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='withdraw', to='user.User', verbose_name='用户')),
            ],
        ),
        migrations.CreateModel(
            name='Reply',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField(blank=True, null=True)),
                ('created', models.DateTimeField(auto_now_add=True, null=True)),
                ('author', models.BooleanField(default=False)),
                ('status', models.BooleanField(default=True)),
                ('comment', models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, related_name='replies', to='user.Comment')),
                ('reply_to', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='replies', to='user.Reply')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='user.User')),
            ],
        ),
        migrations.CreateModel(
            name='Rank',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rank', models.DecimalField(decimal_places=2, max_digits=6, verbose_name='评分')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('status', models.BooleanField(default=True)),
                ('course', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='rank', to='course.Course', verbose_name='课程')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rank', to='user.User')),
            ],
        ),
        migrations.CreateModel(
            name='PromotionBase',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('classification', models.IntegerField(choices=[(1, '定额卷'), (2, '折扣卷')], verbose_name='优惠卷类型')),
                ('value', models.DecimalField(decimal_places=2, max_digits=5, null=True, verbose_name='折扣值')),
                ('brief', models.TextField(verbose_name='优惠卷使用说明')),
                ('started', models.DateTimeField(blank=True, null=True, verbose_name='优惠开始')),
                ('expire', models.DateTimeField(blank=True, null=True, verbose_name='过期时间')),
                ('gen_count', models.IntegerField(blank=True, null=True, verbose_name='生成优惠卷数量')),
                ('share', models.BooleanField(default=False, verbose_name='是否由分享获得')),
                ('share_uuid', models.CharField(blank=True, max_length=32, null=True)),
                ('course', models.ManyToManyField(related_name='promotion_base', to='course.Course', verbose_name='使用范围')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='promotion_base', to='user.User')),
            ],
            options={
                'verbose_name': '优惠卷',
            },
        ),
        migrations.CreateModel(
            name='Promotion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=32, null=True, verbose_name='优惠码')),
                ('status', models.BooleanField(default=False, verbose_name='是否使用')),
                ('value', models.DecimalField(decimal_places=2, max_digits=5, null=True, verbose_name='折扣值')),
                ('classification', models.IntegerField(default=1, verbose_name='优惠卷类型')),
                ('started', models.DateTimeField(blank=True, null=True, verbose_name='优惠开始')),
                ('expire', models.DateTimeField(blank=True, null=True, verbose_name='过期时间')),
                ('brief', models.TextField(null=True, verbose_name='优惠卷使用说明')),
                ('binding_time', models.DateTimeField(null=True, verbose_name='绑定时间')),
                ('using_time', models.DateTimeField(null=True, verbose_name='使用时间')),
                ('base', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='gen_promotions', to='user.PromotionBase')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='promotions', to='user.User', verbose_name='绑定用户')),
            ],
            options={
                'verbose_name_plural': '优惠卷码',
            },
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order_num', models.CharField(max_length=128, null=True, unique=True, verbose_name='订单号')),
                ('final_price', models.DecimalField(decimal_places=2, max_digits=10, null=True, verbose_name='交易价格')),
                ('start_time', models.DateTimeField(auto_now_add=True, verbose_name='交易开始时间')),
                ('end_time', models.DateTimeField(blank=True, null=True, verbose_name='交易结束时间')),
                ('pic', models.CharField(max_length=128, null=True, verbose_name='交易快照')),
                ('paid', models.BooleanField(default=False, verbose_name='是否支付')),
                ('course', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='orders', to='course.Course', verbose_name='课程')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='orders', to='user.User', verbose_name='用户')),
            ],
        ),
        migrations.CreateModel(
            name='Notification',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('read', models.BooleanField(default=False)),
                ('classification', models.CharField(max_length=32, verbose_name='通知类型')),
                ('content', models.CharField(default='', max_length=256, verbose_name='通知内容')),
                ('comment', models.CharField(default='', max_length=256, verbose_name='回复消息')),
                ('url', models.CharField(max_length=256, verbose_name='跳转url')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('from_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='from_user', to='user.User')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to='user.User')),
            ],
        ),
        migrations.CreateModel(
            name='HistoryLecture',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('study_length', models.IntegerField(default=0)),
                ('study_time', models.DateTimeField(auto_now_add=True)),
                ('history_course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lectures', to='user.HistoryCourse')),
                ('lecture', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='course.Lecture')),
            ],
        ),
        migrations.CreateModel(
            name='Favour',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('course', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='favour', to='course.Course', verbose_name='课程')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='favour', to='user.User')),
            ],
        ),
        migrations.CreateModel(
            name='Earning',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('target', models.CharField(choices=[('course', '普通课程'), ('micro', '微课'), ('demo', 'Demo')], max_length=12, null=True)),
                ('value', models.DecimalField(decimal_places=2, max_digits=6)),
                ('approach', models.CharField(choices=[('share', '分享收益'), ('sale', '销售收益')], max_length=32)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('order', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='earnings', to='user.Order')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='earnings', to='user.User')),
            ],
        ),
    ]

<filename>user/migrations/0003_comment_earning_favour_historycourse_historylecture_notification_order_promotion_promotionbase_rank_.py
# Generated by Django 3.0.3 on 2020-03-07 10:37

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


class Migration(migrations.Migration):

    dependencies = [
        ('course', '0001_initial'),
        ('user', '0002_auto_20200302_1621'),
    ]

    operations = [
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField(blank=True, null=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('status', models.BooleanField(default=True)),
                ('course', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='course.Course', verbose_name='课程')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='user.User')),
            ],
        ),
        migrations.CreateModel(
            name='HistoryCourse',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('study_length', models.IntegerField(default=0)),
                ('study_time', models.DateTimeField(auto_now_add=True)),
                ('course', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='history', to='course.Course', verbose_name='课程')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='history', to='user.User')),
            ],
        ),
        migrations.CreateModel(
            name='SaleData',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('course_classification', models.IntegerField(choices=[(0, '普通课程'), (1, '微课'), (2, 'Demo'), (3, '总量')], verbose_name='课程类型')),
            ],
            options={
                'verbose_name': '销售数据',
            },
        ),
        migrations.CreateModel(
            name='UserData',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_classification', models.IntegerField(choices=[(-1, '所有用户'), (0, '官方账号'), (1, '普通用户')], verbose_name='用户类型')),
            ],
            options={
                'verbose_name': '用户数据',
            },
        ),
        migrations.CreateModel(
            name='WithdrawRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('alipay', models.CharField(max_length=32, null=True, verbose_name='支付宝账号')),
                ('real_name', models.CharField(max_length=32, null=True, verbose_name='真实姓名')),
                ('value', models.DecimalField(decimal_places=2, max_digits=6, verbose_name='提现金额')),
                ('status', models.IntegerField(choices=[(0, '提现成功'), (1, '审核中'), (2, '提现失败')], default=1, verbose_name='提现状态')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='withdraw', to='user.User', verbose_name='用户')),
            ],
        ),
        migrations.CreateModel(
            name='Reply',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField(blank=True, null=True)),
                ('created', models.DateTimeField(auto_now_add=True, null=True)),
                ('author', models.BooleanField(default=False)),
                ('status', models.BooleanField(default=True)),
                ('comment', models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, related_name='replies', to='user.Comment')),
                ('reply_to', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='replies', to='user.Reply')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='user.User')),
            ],
        ),
        migrations.CreateModel(
            name='Rank',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rank', models.DecimalField(decimal_places=2, max_digits=6, verbose_name='评分')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('status', models.BooleanField(default=True)),
                ('course', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='rank', to='course.Course', verbose_name='课程')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rank', to='user.User')),
            ],
        ),
        migrations.CreateModel(
            name='PromotionBase',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('classification', models.IntegerField(choices=[(1, '定额卷'), (2, '折扣卷')], verbose_name='优惠卷类型')),
                ('value', models.DecimalField(decimal_places=2, max_digits=5, null=True, verbose_name='折扣值')),
                ('brief', models.TextField(verbose_name='优惠卷使用说明')),
                ('started', models.DateTimeField(blank=True, null=True, verbose_name='优惠开始')),
                ('expire', models.DateTimeField(blank=True, null=True, verbose_name='过期时间')),
                ('gen_count', models.IntegerField(blank=True, null=True, verbose_name='生成优惠卷数量')),
                ('share', models.BooleanField(default=False, verbose_name='是否由分享获得')),
                ('share_uuid', models.CharField(blank=True, max_length=32, null=True)),
                ('course', models.ManyToManyField(related_name='promotion_base', to='course.Course', verbose_name='使用范围')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='promotion_base', to='user.User')),
            ],
            options={
                'verbose_name': '优惠卷',
            },
        ),
        migrations.CreateModel(
            name='Promotion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=32, null=True, verbose_name='优惠码')),
                ('status', models.BooleanField(default=False, verbose_name='是否使用')),
                ('value', models.DecimalField(decimal_places=2, max_digits=5, null=True, verbose_name='折扣值')),
                ('classification', models.IntegerField(default=1, verbose_name='优惠卷类型')),
                ('started', models.DateTimeField(blank=True, null=True, verbose_name='优惠开始')),
                ('expire', models.DateTimeField(blank=True, null=True, verbose_name='过期时间')),
                ('brief', models.TextField(null=True, verbose_name='优惠卷使用说明')),
                ('binding_time', models.DateTimeField(null=True, verbose_name='绑定时间')),
                ('using_time', models.DateTimeField(null=True, verbose_name='使用时间')),
                ('base', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='gen_promotions', to='user.PromotionBase')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='promotions', to='user.User', verbose_name='绑定用户')),
            ],
            options={
                'verbose_name_plural': '优惠卷码',
            },
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order_num', models.CharField(max_length=128, null=True, unique=True, verbose_name='订单号')),
                ('final_price', models.DecimalField(decimal_places=2, max_digits=10, null=True, verbose_name='交易价格')),
                ('start_time', models.DateTimeField(auto_now_add=True, verbose_name='交易开始时间')),
                ('end_time', models.DateTimeField(blank=True, null=True, verbose_name='交易结束时间')),
                ('pic', models.CharField(max_length=128, null=True, verbose_name='交易快照')),
                ('paid', models.BooleanField(default=False, verbose_name='是否支付')),
                ('course', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='orders', to='course.Course', verbose_name='课程')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='orders', to='user.User', verbose_name='用户')),
            ],
        ),
        migrations.CreateModel(
            name='Notification',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('read', models.BooleanField(default=False)),
                ('classification', models.CharField(max_length=32, verbose_name='通知类型')),
                ('content', models.CharField(default='', max_length=256, verbose_name='通知内容')),
                ('comment', models.CharField(default='', max_length=256, verbose_name='回复消息')),
                ('url', models.CharField(max_length=256, verbose_name='跳转url')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('from_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='from_user', to='user.User')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to='user.User')),
            ],
        ),
        migrations.CreateModel(
            name='HistoryLecture',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('study_length', models.IntegerField(default=0)),
                ('study_time', models.DateTimeField(auto_now_add=True)),
                ('history_course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lectures', to='user.HistoryCourse')),
                ('lecture', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='course.Lecture')),
            ],
        ),
        migrations.CreateModel(
            name='Favour',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('course', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='favour', to='course.Course', verbose_name='课程')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='favour', to='user.User')),
            ],
        ),
        migrations.CreateModel(
            name='Earning',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('target', models.CharField(choices=[('course', '普通课程'), ('micro', '微课'), ('demo', 'Demo')], max_length=12, null=True)),
                ('value', models.DecimalField(decimal_places=2, max_digits=6)),
                ('approach', models.CharField(choices=[('share', '分享收益'), ('sale', '销售收益')], max_length=32)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('order', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='earnings', to='user.Order')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='earnings', to='user.User')),
            ],
        ),
    ]

# Generated by Django 3.0.3 on 2020-03-07 10:37