# Generated by Django 2.1.7 on 2020-08-27 06:52

import datetime
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            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')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('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')),
                ('user_stats', models.CharField(blank=True, default='2', max_length=8, null=True, verbose_name='用户状态，0：已删除，1：已登录，2：未登录')),
                ('token', models.CharField(blank=True, max_length=128, null=True, verbose_name='认证token，明文存储')),
            ],
            options={
                'verbose_name': '用户',
                'verbose_name_plural': '用户',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='CustomerAddr',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_id', models.IntegerField(unique=True, verbose_name='user表的自增ID')),
                ('postcode', models.IntegerField(blank=True, default=0, null=True, verbose_name='邮编')),
                ('province', models.CharField(blank=True, max_length=255, null=True, verbose_name='地区表中省份的ID')),
                ('city', models.CharField(blank=True, max_length=255, null=True, verbose_name='地区表中城市的ID')),
                ('district', models.CharField(blank=True, max_length=255, null=True, verbose_name='地区表中的区ID')),
                ('address', models.CharField(blank=True, max_length=255, null=True, verbose_name='具体的地址门牌号')),
                ('is_default', models.IntegerField(blank=True, null=True, verbose_name='是否默认，0：否，1：是')),
                ('modify_time', models.DateTimeField(blank=True, default=datetime.datetime(2020, 8, 27, 14, 51, 58, 161092), null=True, verbose_name='最后修改时间')),
            ],
            options={
                'verbose_name': '用户地址',
                'verbose_name_plural': '用户地址',
                'db_table': 'cus_customer_addr',
            },
        ),
        migrations.CreateModel(
            name='CustomerBalanceLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_id', models.IntegerField(blank=True, null=True, verbose_name='用户ID')),
                ('source', models.CharField(blank=True, max_length=8, null=True, verbose_name='记录来源：1：订单，2：退货单')),
                ('source_sn', models.CharField(blank=True, max_length=255, null=True, verbose_name='相关单据单号')),
                ('amount', models.IntegerField(blank=True, default=0, null=True, verbose_name='变动金额')),
                ('created_time', models.DateTimeField(blank=True, default=datetime.datetime(2020, 8, 27, 14, 51, 58, 162092), null=True, verbose_name='记录生成时间')),
            ],
            options={
                'verbose_name': '用户余额变动',
                'verbose_name_plural': '用户余额变动',
                'db_table': 'cus_customer_balance_log',
            },
        ),
        migrations.CreateModel(
            name='CustomerInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nickname', models.CharField(blank=True, max_length=32, null=True, unique=True, verbose_name='昵称')),
                ('identity_card_type', models.CharField(blank=True, max_length=8, null=True, verbose_name='证件类型：1：身份证，2：军官证，3：护照')),
                ('identity_card_no', models.CharField(blank=True, max_length=64, null=True, unique=True, verbose_name='证件号码')),
                ('mobile_phone', models.CharField(blank=True, max_length=16, null=True, unique=True, verbose_name='手机号')),
                ('gender', models.CharField(blank=True, choices=[('Male', '男'), ('Female', '女')], max_length=16, null=True, verbose_name='性别')),
                ('user_point', models.IntegerField(blank=True, default=0, null=True, verbose_name='用户积分')),
                ('register_time', models.DateTimeField(blank=True, null=True, verbose_name='注册时间')),
                ('birthday', models.DateField(blank=True, null=True, verbose_name='会员生日')),
                ('customer_level', models.CharField(blank=True, default='1', max_length=16, null=True, verbose_name='会员级别：1：普通会员，2：青铜，3：白银，4：黄金，5：钻石')),
                ('user_money', models.FloatField(blank=True, default=0.0, null=True, verbose_name='用户余额')),
                ('modify_time', models.DateTimeField(blank=True, default=datetime.datetime(2020, 8, 27, 14, 51, 58, 161092), null=True, verbose_name='最后修改时间')),
            ],
            options={
                'verbose_name': '用户信息',
                'verbose_name_plural': '用户信息',
                'db_table': 'cus_customer_info',
            },
        ),
        migrations.CreateModel(
            name='CustomerLevelInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('level_name', models.CharField(max_length=32, unique=True, verbose_name='会员级别名称')),
                ('min_point', models.IntegerField(blank=True, default=0, null=True, verbose_name='该级别最低积分')),
                ('max_point', models.IntegerField(blank=True, default=0, null=True, verbose_name='该级别最高积分')),
                ('modify_time', models.DateTimeField(blank=True, default=datetime.datetime(2020, 8, 27, 14, 51, 58, 161092), null=True, verbose_name='最后修改时间')),
            ],
            options={
                'verbose_name': '用户级别信息',
                'verbose_name_plural': '用户级别信息',
                'db_table': 'cus_customer_level_info',
            },
        ),
        migrations.CreateModel(
            name='CustomerLoginLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_id', models.IntegerField(blank=True, null=True, verbose_name='用户ID')),
                ('login_time', models.DateTimeField(blank=True, default=datetime.datetime(2020, 8, 27, 14, 51, 58, 163092), null=True, verbose_name='用户登录时间')),
                ('login_ip', models.CharField(blank=True, max_length=255, null=True, verbose_name='登陆ip')),
                ('login_status', models.IntegerField(blank=True, default=0, null=True, verbose_name='登陆状态：0:未成功，1:成功')),
            ],
            options={
                'verbose_name': '用户登录日志',
                'verbose_name_plural': '用户登录日志',
                'db_table': 'cus_customer_login_log',
            },
        ),
        migrations.CreateModel(
            name='CustomerPointLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_id', models.IntegerField(blank=True, null=True, verbose_name='用户ID')),
                ('source', models.CharField(blank=True, max_length=8, null=True, verbose_name='积分来源：1：订单，2：登陆，3：活动')),
                ('refer_number', models.CharField(blank=True, max_length=255, null=True, verbose_name='积分来源相关编号')),
                ('change_point', models.IntegerField(blank=True, default=0, null=True, verbose_name='变更积分数')),
                ('created_time', models.DateTimeField(blank=True, default=datetime.datetime(2020, 8, 27, 14, 51, 58, 162092), null=True, verbose_name='积分日志生成时间')),
            ],
            options={
                'verbose_name': '用户积分日志',
                'verbose_name_plural': '用户积分日志',
                'db_table': 'cus_customer_point_log',
            },
        ),
        migrations.AddField(
            model_name='user',
            name='customer',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='customer.CustomerInfo', verbose_name='用户资料表自增id'),
        ),
        migrations.AddField(
            model_name='user',
            name='groups',
            field=models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions'),
        ),
    ]
