# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-06-27 11:58
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('app', '0001_initial'),
        ('user_group', '0003_usergroup_users'),
    ]

    operations = [
        migrations.CreateModel(
            name='Channel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('updated_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(default='', max_length=255, verbose_name='渠道显示名称')),
                ('display_name', models.CharField(default='', max_length=255, verbose_name='渠道显示名称')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='InnerStrategy',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('updated_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(default='', max_length=255, verbose_name='内灰策略名称')),
                ('push_content', models.TextField(default='', verbose_name='推送内容')),
                ('app', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.App')),
                ('creator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='OuterStrategy',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('updated_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(default='', max_length=255, verbose_name='外灰策略名称')),
                ('version', models.CharField(default='', max_length=255, verbose_name='版本')),
                ('allow_users', models.TextField(verbose_name="外灰用户列表", default="")),
                ('range_dates', models.CharField(default='', max_length=2048, verbose_name='外灰时间范围及次数限额')),
                ('cities', models.CharField(default='', max_length=1024, verbose_name='城市列表')),
                ('city_enable', models.BooleanField(default=True, verbose_name='包含或不包含城市')),
                ('channel', models.CharField(default='', max_length=128, verbose_name='渠道')),
                ('percentage', models.IntegerField(default=0, verbose_name='百分比')),
                ('status', models.BooleanField(default=False, verbose_name='状态')),
                ('is_compatible', models.IntegerField(default=0, verbose_name='是否强制执行')),
                ('frequency', models.IntegerField(default=0, verbose_name='每天提示次数')),
                ('change_log', models.TextField(verbose_name="推送给app的内容", default="")),
                ('change_log_img', models.CharField(default='', max_length=200, verbose_name='上传到图床返回的名称')),
                ('app', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.App')),
                ('creator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PushChannel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('updated_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(default='', max_length=255, verbose_name='推送类型名称')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='innerstrategy',
            name='push_channels',
            field=models.ManyToManyField(blank=True, to='strategy.PushChannel'),
        ),
        migrations.AddField(
            model_name='innerstrategy',
            name='user_groups',
            field=models.ManyToManyField(blank=True, to='user_group.UserGroup'),
        ),
    ]
