# Generated by Django 3.0.1 on 2020-02-10 07:04

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Family',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('location', models.CharField(max_length=50, verbose_name='所在城市/村镇')),
                ('address', models.CharField(max_length=255, null=True, verbose_name='家庭住址')),
                ('status', models.IntegerField(choices=[(0, '失效'), (1, '正常')], default=1, verbose_name='状态')),
                ('remark', models.CharField(max_length=255, null=True, verbose_name='备注')),
            ],
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='姓名')),
                ('gender', models.IntegerField(choices=[(0, '女'), (1, '男')], verbose_name='性别')),
                ('birthDate', models.DateField(null=True, verbose_name='出生日期')),
                ('relType', models.IntegerField(choices=[(1, '血亲'), (2, '姻亲'), (3, '同学'), (4, '朋友'), (5, '同事'), (6, '战友'), (7, '街坊'), (0, '其他')], verbose_name='关系类型')),
                ('Marriage', models.IntegerField(choices=[(0, '未婚'), (1, '已婚')], default=0, verbose_name='婚姻状况')),
                ('mobile', models.CharField(max_length=20, null=True, verbose_name='手机号码')),
                ('weixin', models.CharField(max_length=50, null=True, verbose_name='微信号码')),
                ('email', models.CharField(max_length=255, null=True, verbose_name='电子邮箱')),
                ('address', models.CharField(max_length=255, null=True, verbose_name='现住址')),
                ('workUnit', models.CharField(max_length=50, null=True, verbose_name='工作单位')),
                ('education', models.IntegerField(choices=[(0, '在读'), (1, '小学'), (2, '初中'), (3, '高中'), (4, '大专'), (5, '本科'), (6, '硕士'), (7, '博士'), (0, '其他')], verbose_name='学历')),
                ('occupation', models.CharField(max_length=20, null=True, verbose_name='职业')),
                ('status', models.IntegerField(choices=[(0, '失效'), (1, '正常')], default=1, verbose_name='状态')),
                ('remark', models.CharField(max_length=255, null=True, verbose_name='备注')),
                ('family', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='personFamily', to='baseinfo.Family', verbose_name='家庭')),
                ('father', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='personFather', to='baseinfo.Person', verbose_name='父亲')),
                ('mother', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='personMother', to='baseinfo.Person', verbose_name='母亲')),
                ('spouse', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='personSpuse', to='baseinfo.Person', verbose_name='配偶')),
            ],
        ),
        migrations.AddField(
            model_name='family',
            name='name',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='FamilyName', to='baseinfo.Person', verbose_name='家长'),
        ),
    ]
