# Generated by Django 4.2.4 on 2023-11-04 13:33

import baykeshop.common.validators
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),
    ]

    operations = [
        migrations.CreateModel(
            name='BaykeUserBalanceLog',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('add_date', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('pub_date', models.DateTimeField(auto_now=True, verbose_name='修改时间')),
                ('is_delete', models.BooleanField(default=False, editable=False, verbose_name='删除标记')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=15, verbose_name='金额')),
                ('change_status', models.PositiveSmallIntegerField(blank=True, choices=[(1, '增加'), (2, '支出')], null=True)),
                ('change_way', models.PositiveSmallIntegerField(choices=[(1, '线上充值'), (2, '管理员手动更改'), (3, '余额抵扣商品')], default=2)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='用户')),
            ],
            options={
                'verbose_name': '余额明细',
                'verbose_name_plural': '余额明细',
            },
        ),
        migrations.CreateModel(
            name='BaykeUser',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('add_date', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('pub_date', models.DateTimeField(auto_now=True, verbose_name='修改时间')),
                ('is_delete', models.BooleanField(default=False, editable=False, verbose_name='删除标记')),
                ('name', models.CharField(max_length=50, verbose_name='姓名')),
                ('phone', models.CharField(blank=True, default='', max_length=11, validators=[baykeshop.common.validators.validate_phone], verbose_name='手机号')),
                ('sex', models.PositiveSmallIntegerField(choices=[(0, '未知'), (1, '男'), (2, '女')], default=0, verbose_name='性别')),
                ('about', models.CharField(blank=True, default='我喜欢baykeshop这个程序！', max_length=150, verbose_name='简介')),
                ('avatar', models.ImageField(blank=True, max_length=200, null=True, upload_to='avatar/', verbose_name='头像')),
                ('balance', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=8, verbose_name='余额')),
                ('owner', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='用户')),
            ],
            options={
                'verbose_name': '用户',
                'verbose_name_plural': '用户',
                'ordering': ['-add_date'],
            },
        ),
    ]
