# Generated by Django 3.0.3 on 2020-02-23 04:46

import chat.utils
import django.core.validators
from django.db import migrations, models
import django.db.models.expressions
import re


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='ChatMenu',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('menu_json', models.TextField(max_length=10240, validators=[chat.utils.json_check], verbose_name='菜单Json')),
                ('create_date', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('short_name', models.CharField(max_length=32, verbose_name='菜单名')),
                ('short_description', models.TextField(blank=True, max_length=256, null=True, verbose_name='菜单描述')),
                ('menu_status', models.CharField(choices=[('using', '使用中'), ('pending', '未试用')], default='pending', max_length=16, verbose_name='菜单状态')),
                ('chat_enable', models.BooleanField(verbose_name='同步到微信')),
            ],
            options={
                'verbose_name': '公众号菜单',
                'verbose_name_plural': '公众号菜单',
                'ordering': [django.db.models.expressions.OrderBy(django.db.models.expressions.F('menu_status'), descending=True, nulls_last=True), 'create_date'],
            },
        ),
        migrations.CreateModel(
            name='Wechat',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('appid', models.CharField(default='', max_length=20, verbose_name='公众号 ID')),
                ('alias', models.CharField(blank=True, max_length=20, null=True, verbose_name='公众号名称')),
                ('service_type', models.IntegerField(choices=[(0, '订阅号'), (1, '升级后的订阅号'), (2, '服务号')], default=0, verbose_name='公众号类型')),
                ('nick_name', models.CharField(blank=True, max_length=32, null=True, verbose_name='昵称')),
                ('head_img', models.URLField(blank=True, max_length=256, null=True, verbose_name='头像')),
                ('user_name', models.CharField(max_length=32, verbose_name='内部名称')),
                ('qrcode_url', models.URLField(blank=True, max_length=256, null=True, verbose_name='二维码URL')),
                ('authorized', models.BooleanField(verbose_name='授权')),
                ('verify_type', models.PositiveIntegerField(choices=[(-1, '未认证'), (0, '微信认证'), (1, '新浪微博认证'), (2, '腾讯微博认证'), (3, '已资质认证通过但还未通过名称认证'), (4, '已资质认证通过、还未通过名称认证，但通过了新浪微博认证'), (5, '已资质认证通过、还未通过名称认证，但通过了腾讯微博认证')], verbose_name='认证类型')),
                ('funcscope_categories', models.CharField(max_length=64, validators=[django.core.validators.RegexValidator(re.compile('^\\d+(?:,\\d+)*\\Z'), code='invalid', message='Enter only digits separated by commas.')], verbose_name='权限集')),
                ('join_time', models.DateTimeField(auto_now_add=True, verbose_name='授权时间')),
            ],
            options={
                'verbose_name': '公众号',
                'verbose_name_plural': '公众号',
                'get_latest_by': 'join_time',
            },
        ),
    ]
