# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-09-04 11:04
from __future__ import unicode_literals

import core.django.constants
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import tinymce.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Notification',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, default='', max_length=200, null=True, verbose_name='标题')),
                ('status', models.PositiveSmallIntegerField(choices=[(0, '未读'), (1, '已读'), (99, '删除')], db_index=True, default=0, verbose_name='读取状态')),
                ('send_time', models.DateTimeField(auto_now_add=True, null=True, verbose_name='发送时间')),
                ('read_time', models.DateTimeField(blank=True, null=True, verbose_name='读取时间')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='数据创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='数据更新时间')),
                ('deleted_at', models.DateTimeField(blank=True, null=True, verbose_name='数据删除时间')),
            ],
            options={
                'verbose_name': '系统通知',
                'verbose_name_plural': '系统通知',
            },
            bases=(models.Model, core.django.constants.ReadStatus),
        ),
        migrations.CreateModel(
            name='NotificationContent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200, verbose_name='标题')),
                ('contents', tinymce.models.HTMLField(blank=True, verbose_name='内容')),
                ('status', models.PositiveSmallIntegerField(choices=[(0, '禁用'), (1, '启用'), (99, '删除')], db_index=True, default=1, verbose_name='状态')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='数据创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='数据更新时间')),
                ('deleted_at', models.DateTimeField(blank=True, null=True, verbose_name='数据删除时间')),
                ('creator', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='数据创建人')),
                ('receivers', models.ManyToManyField(blank=True, help_text='不选则发送给全体用户', related_name='notification_receivers', to=settings.AUTH_USER_MODEL, verbose_name='收件人')),
            ],
            options={
                'verbose_name': '系统通知内容',
                'verbose_name_plural': '系统通知内容',
            },
            bases=(models.Model, core.django.constants.UsableStatus),
        ),
        migrations.CreateModel(
            name='SiteMailContent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200, verbose_name='标题')),
                ('contents', tinymce.models.HTMLField(blank=True, verbose_name='内容')),
                ('status', models.PositiveSmallIntegerField(choices=[(0, '禁用'), (1, '启用'), (99, '删除')], db_index=True, default=1, verbose_name='状态')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='数据创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='数据更新时间')),
                ('deleted_at', models.DateTimeField(blank=True, null=True, verbose_name='数据删除时间')),
                ('creator', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='数据创建人')),
                ('receivers', models.ManyToManyField(blank=True, related_name='sitemail_receivers', to=settings.AUTH_USER_MODEL, verbose_name='收件人')),
            ],
            options={
                'verbose_name': '站内邮件内容',
                'verbose_name_plural': '站内邮件内容',
            },
            bases=(models.Model, core.django.constants.UsableStatus),
        ),
        migrations.CreateModel(
            name='SiteMailReceive',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200, verbose_name='主题')),
                ('send_time', models.DateTimeField(auto_now_add=True, null=True, verbose_name='发送时间')),
                ('status', models.PositiveSmallIntegerField(choices=[(0, '未读'), (1, '已读'), (2, '草稿'), (3, '回收站'), (99, '删除')], db_index=True, default=0, verbose_name='读取状态')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='数据创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='数据更新时间')),
                ('deleted_at', models.DateTimeField(blank=True, null=True, verbose_name='数据删除时间')),
                ('read_time', models.DateTimeField(blank=True, null=True, verbose_name='读取时间')),
                ('content', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='messageset.SiteMailContent', verbose_name='内容')),
                ('creator', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='数据创建人')),
                ('receiver', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sitemailreceive_receive', to=settings.AUTH_USER_MODEL, verbose_name='收件人')),
                ('sender', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='发件人')),
            ],
            options={
                'verbose_name': '收件箱',
                'verbose_name_plural': '收件箱',
            },
            bases=(models.Model, core.django.constants.MailStatus),
        ),
        migrations.CreateModel(
            name='SiteMailSend',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200, verbose_name='主题')),
                ('send_time', models.DateTimeField(auto_now_add=True, null=True, verbose_name='发送时间')),
                ('status', models.PositiveSmallIntegerField(choices=[(0, '未读'), (1, '已读'), (2, '草稿'), (3, '回收站'), (99, '删除')], db_index=True, default=0, verbose_name='读取状态')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='数据创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='数据更新时间')),
                ('deleted_at', models.DateTimeField(blank=True, null=True, verbose_name='数据删除时间')),
                ('content', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='messageset.SiteMailContent', verbose_name='内容')),
                ('creator', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='数据创建人')),
                ('sender', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='发件人')),
            ],
            options={
                'verbose_name': '发件箱',
                'verbose_name_plural': '发件箱',
            },
            bases=(models.Model, core.django.constants.MailStatus),
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, verbose_name='任务名称')),
                ('percent', models.PositiveIntegerField(default=0, verbose_name='进度')),
                ('start_app', models.CharField(blank=True, max_length=255, null=True, verbose_name='发起app')),
                ('status', models.PositiveSmallIntegerField(choices=[(0, '正常(进行中)'), (1, '异常'), (2, '完成'), (99, '删除')], db_index=True, default=0, verbose_name='状态')),
                ('start_time', models.DateTimeField(auto_now_add=True, null=True, verbose_name='开始时间')),
                ('end_time', models.DateTimeField(blank=True, null=True, verbose_name='结束时间')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='数据创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='数据更新时间')),
                ('deleted_at', models.DateTimeField(blank=True, null=True, verbose_name='数据删除时间')),
                ('creator', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='数据创建人')),
            ],
            options={
                'verbose_name': '后台任务',
                'verbose_name_plural': '后台任务',
            },
            bases=(models.Model, core.django.constants.TaskStatus),
        ),
        migrations.AddField(
            model_name='notification',
            name='content',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='messageset.NotificationContent', verbose_name='内容'),
        ),
        migrations.AddField(
            model_name='notification',
            name='creator',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='数据创建人'),
        ),
        migrations.AddField(
            model_name='notification',
            name='receiver',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='收件人'),
        ),
    ]
