# Generated by Django 2.0 on 2019-02-12 06:20

import eeapp.base.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order', models.IntegerField(default=0, verbose_name='排序')),
                ('street', models.CharField(default='', max_length=300)),
                ('address', models.CharField(default='', max_length=300)),
                ('post_code', models.CharField(default='', max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='Admin',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('display_name', models.CharField(default='', max_length=255, verbose_name='昵称')),
                ('VALID', models.BooleanField(default=True)),
                ('role', models.CharField(default='base', max_length=10)),
                ('wxopenid', models.CharField(default='', max_length=64)),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('mobile', models.CharField(max_length=20, verbose_name='手机号')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', eeapp.base.models.UManager()),
            ],
        ),
        migrations.CreateModel(
            name='AdminToken',
            fields=[
                ('key', models.CharField(max_length=40, primary_key=True, serialize=False, verbose_name='Key')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('user', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='auth_token', to='eeapp.jsonapi.location.Admin', verbose_name='User')),
            ],
            options={
                'verbose_name': 'Token',
                'verbose_name_plural': 'Tokens',
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Area',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('area_id', models.CharField(default=None, max_length=50, verbose_name='地区编号')),
                ('area', models.CharField(default=None, max_length=60, verbose_name='区')),
                ('order', models.IntegerField(default=0, verbose_name='排序')),
            ],
        ),
        migrations.CreateModel(
            name='City',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('city_id', models.CharField(default=None, max_length=6, verbose_name='城市编号')),
                ('city', models.CharField(default=None, max_length=50, verbose_name='市/县')),
                ('order', models.IntegerField(default=0, verbose_name='排序')),
            ],
        ),
        migrations.CreateModel(
            name='Province',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('province_id', models.CharField(default=None, max_length=6, verbose_name='省份编号')),
                ('province', models.CharField(default=None, max_length=40, verbose_name='省份')),
                ('order', models.IntegerField(default=0, verbose_name='排序')),
            ],
        ),
        migrations.AddField(
            model_name='city',
            name='father',
            field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.DO_NOTHING, related_name='cities', to='eeapp.jsonapi.location.Province', verbose_name='所属省份'),
        ),
        migrations.AddField(
            model_name='area',
            name='father',
            field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.DO_NOTHING, related_name='areas', to='eeapp.jsonapi.location.City', verbose_name='所属城市'),
        ),
        migrations.AddField(
            model_name='address',
            name='area',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='eeapp.jsonapi.location.Area'),
        ),
    ]
