# Generated by Django 2.1.3 on 2018-12-07 13:23

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='BabyInfo',
            fields=[
                ('bid', models.AutoField(max_length=10, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=30, verbose_name='姓名')),
                ('sex', models.CharField(choices=[('A', '男'), ('B', '女')], default='A', max_length=10, verbose_name='性別')),
                ('age', models.CharField(max_length=10, verbose_name='年龄')),
                ('birthday', models.DateField(max_length=10, verbose_name='生日')),
                ('height', models.CharField(blank=True, max_length=20, verbose_name='身高')),
                ('weight', models.CharField(blank=True, max_length=20, verbose_name='体重')),
            ],
        ),
        migrations.CreateModel(
            name='BabyPhoto',
            fields=[
                ('pid', models.AutoField(max_length=20, primary_key=True, serialize=False)),
                ('imageurl', models.CharField(max_length=500)),
                ('imagepath', models.CharField(max_length=200)),
                ('createtime', models.DateTimeField(default=django.utils.timezone.now)),
                ('bid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='baby.BabyInfo')),
            ],
        ),
        migrations.CreateModel(
            name='BabyRecord',
            fields=[
                ('id', models.AutoField(max_length=20, primary_key=True, serialize=False)),
                ('type', models.CharField(choices=[('A', '母乳'), ('B', '奶粉'), ('C', '拉臭臭'), ('D', '换尿不湿'), ('E', '睡觉')], default='A', max_length=10, verbose_name='记录类型')),
                ('volume', models.CharField(blank=True, max_length=50, verbose_name='喂养量')),
                ('starttime', models.DateTimeField(verbose_name='开始时间')),
                ('endtime', models.DateTimeField(verbose_name='结束时间')),
                ('recordtime', models.DateTimeField(default=django.utils.timezone.now, verbose_name='记录时间')),
                ('bid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='baby', related_query_name='baby', to='baby.BabyInfo')),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('uid', models.CharField(max_length=50, primary_key=True, serialize=False)),
                ('nickname', models.CharField(max_length=50, verbose_name='用户昵称')),
                ('avatarurl', models.CharField(max_length=100, verbose_name='用户头像')),
                ('openid', models.CharField(blank=True, max_length=100)),
                ('username', models.CharField(blank=True, max_length=20)),
                ('userpwd', models.CharField(blank=True, max_length=50)),
                ('bid', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='babyinfo', related_query_name='babyinfo', to='baby.BabyInfo')),
            ],
        ),
        migrations.AddField(
            model_name='babyrecord',
            name='uid',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user', related_query_name='user', to='baby.User', verbose_name='记录人'),
        ),
        migrations.AddField(
            model_name='babyphoto',
            name='uid',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='baby.User'),
        ),
    ]
