# Generated by Django 2.0.2 on 2018-02-09 10:46

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Account',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('openid', models.CharField(max_length=100, unique=True)),
                ('nickname', models.CharField(max_length=100)),
                ('sex', models.IntegerField(choices=[(0, '未知'), (1, '男'), (2, '女')])),
                ('city', models.CharField(max_length=50)),
                ('province', models.CharField(max_length=50)),
                ('country', models.CharField(max_length=50)),
                ('headimgurl', models.CharField(max_length=250)),
                ('subscribed_at', models.DateTimeField()),
                ('unionid', models.CharField(max_length=200)),
                ('remark', models.CharField(max_length=100)),
                ('status', models.CharField(default='subscribe', max_length=20)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='MessageTemplate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.CharField(default='', max_length=50)),
                ('template_id', models.CharField(max_length=50, unique=True)),
                ('title', models.CharField(blank=True, default='', max_length=50)),
                ('primary_industry', models.CharField(blank=True, default='', max_length=50)),
                ('deputy_industry', models.CharField(blank=True, default='', max_length=50)),
                ('content', models.TextField(blank=True, default='')),
                ('example', models.TextField(blank=True, default='')),
                ('url', models.CharField(blank=True, default='', max_length=500)),
            ],
        ),
        migrations.CreateModel(
            name='Tenant',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('chinese_name', models.CharField(help_text='中文名称，标示该商户', max_length=50)),
                ('name', models.CharField(max_length=50, unique=True)),
                ('enable', models.BooleanField(default=True)),
                ('kefuxinxi', models.TextField(blank=True, default='--')),
                ('appid', models.CharField(max_length=200, unique=True)),
                ('secret', models.CharField(help_text='开发者密码', max_length=200, unique=True)),
                ('token', models.CharField(default='', help_text='令牌', max_length=100)),
                ('encoding_aeskey', models.CharField(blank=True, default='', help_text='消息加解密密钥', max_length=200)),
                ('_access_token', models.CharField(blank=True, default='', max_length=200, unique=True)),
                ('access_token_expired_at', models.DateTimeField(blank=True, default=None, null=True)),
                ('_jsapi_ticket', models.CharField(blank=True, default='', max_length=200, unique=True)),
                ('jsapi_ticket_expired_at', models.DateTimeField(blank=True, default=None, null=True)),
                ('shanghu_id', models.CharField(blank=True, default='', help_text='微信支付商户号', max_length=50, unique=True)),
                ('payment_api_key', models.CharField(blank=True, default='', help_text='微信支付商户的API密钥', max_length=200)),
                ('payment_notify_url', models.CharField(blank=True, default='', help_text='支付回调接口', max_length=200)),
                ('refund_notify_url', models.CharField(blank=True, default='', help_text='退款回调接口', max_length=200)),
                ('apiclient_cert_pem', models.FileField(blank=True, default=None, null=True, upload_to=wxmgmt.models.attachment_filename)),
                ('apiclient_key_pem', models.FileField(blank=True, default=None, null=True, upload_to=wxmgmt.models.attachment_filename)),
                ('apiclient_cert_p12', models.FileField(blank=True, default=None, null=True, upload_to=wxmgmt.models.attachment_filename)),
                ('rootca_pem', models.FileField(blank=True, default=None, null=True, upload_to=wxmgmt.models.attachment_filename)),
                ('menu', models.TextField(blank=True, default=None, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('managers', models.ManyToManyField(blank=True, help_text='设置管理员账号，用于接收通知类消息', related_name='parents', to='wxmgmt.Account')),
            ],
        ),
        migrations.AddField(
            model_name='messagetemplate',
            name='tenant',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wxmgmt.Tenant'),
        ),
        migrations.AddField(
            model_name='account',
            name='tenant',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wxmgmt.Tenant'),
        ),
    ]
