# Generated by Django 2.1.2 on 2018-10-12 09:08

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('platform', models.IntegerField(choices=[(0, 'Web'), (1, 'Mina')], verbose_name='Platform')),
                ('identifier', models.IntegerField(choices=[(0, 'OpenID'), (1, 'UnionID')], verbose_name='Identifier')),
                ('last_logined_at', models.DateTimeField(blank=True, db_index=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
            ],
        ),
        migrations.CreateModel(
            name='UserInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nickname', models.CharField(blank=True, max_length=64, null=True, verbose_name='Nick name')),
                ('avatar_url', models.URLField(blank=True, max_length=255, null=True, verbose_name='Avatar URL')),
                ('gender', models.SmallIntegerField(choices=[(0, 'Unknown'), (1, 'Male'), (2, 'Female')], default=0, verbose_name='Gender')),
                ('city', models.CharField(blank=True, max_length=32, null=True, verbose_name='City')),
                ('province', models.CharField(blank=True, max_length=32, null=True, verbose_name='Province')),
                ('country', models.CharField(blank=True, max_length=32, null=True, verbose_name='Country')),
                ('language', models.CharField(blank=True, max_length=16, null=True, verbose_name='Language')),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('owner', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='info', related_query_name='info', to='wechat_user.User', verbose_name='User')),
            ],
        ),
        migrations.CreateModel(
            name='UserMobilePhone',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.CharField(max_length=16, verbose_name='Phone number')),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('owner', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='phone', related_query_name='phone', to='wechat_user.User', verbose_name='User')),
            ],
        ),
        migrations.CreateModel(
            name='UserOpenId',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.CharField(db_index=True, max_length=32, verbose_name='Open ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='openids', related_query_name='openid', to='wechat_user.User', verbose_name='Open Id')),
            ],
        ),
        migrations.CreateModel(
            name='UserUnionId',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.CharField(db_index=True, max_length=32, verbose_name='Open ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('owner', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='unionid', related_query_name='unionid', to='wechat_user.User', verbose_name='Union ID')),
            ],
        ),
    ]
