# Generated by Django 3.0.7 on 2020-07-09 07:22

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import simple_history.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('system', '0021_auto_20200616_1722'),
        ('certset', '0009_auto_20200709_1522'),
    ]

    operations = [
        migrations.CreateModel(
            name='Ability',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('access_date', models.DateField(verbose_name='评定时间')),
                ('remark', models.TextField(verbose_name='备注')),
                ('is_paused', models.BooleanField(default=False, verbose_name='是否暂停')),
                ('afrom', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ability_afrom', to='system.Dict', verbose_name='能力来源')),
                ('auditor_abilitys', models.ManyToManyField(related_name='ability_auditor_abilitys', to='system.Dict', verbose_name='能力项')),
                ('cert_field', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ability_cert_field', to='system.Dict', verbose_name='认证领域')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ability_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('employee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ability_employee', to=settings.AUTH_USER_MODEL)),
                ('major', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ability_major', to='system.Dict', verbose_name='专业代码')),
                ('major_rule', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ability_major_rule', to='certset.ImplementRule', verbose_name='专业(ccc)')),
            ],
            options={
                'verbose_name': '专业能力',
                'verbose_name_plural': '专业能力',
            },
        ),
        migrations.CreateModel(
            name='UserDetail',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('code', models.CharField(blank=True, max_length=30, null=True, verbose_name='编号')),
                ('remember_code', models.CharField(blank=True, max_length=30, null=True, verbose_name='易记码')),
                ('gengder', models.CharField(choices=[('男', '男'), ('女', '女')], default='男', max_length=50, verbose_name='性别')),
                ('landline', models.CharField(blank=True, max_length=100, null=True, verbose_name='座机')),
                ('email', models.EmailField(blank=True, max_length=254, null=True, verbose_name='邮箱')),
                ('birth', models.DateField(blank=True, null=True, verbose_name='出生日期')),
                ('ID_number', models.CharField(blank=True, max_length=100, null=True, verbose_name='身份证号')),
                ('is_onjob', models.BooleanField(default=True, verbose_name='是否在职')),
                ('is_fulltime', models.BooleanField(default=True, verbose_name='是否专职')),
                ('is_payinsurance', models.BooleanField(default=True, verbose_name='是否缴纳保险')),
                ('finance_number', models.CharField(blank=True, max_length=30, null=True, verbose_name='财务编号')),
                ('address', models.TextField(blank=True, null=True, verbose_name='详细地址')),
                ('signature', models.CharField(blank=True, max_length=200, null=True, verbose_name='签名图片')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='userdetail_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('employee', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('fee_level', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='userdetail_fee_level', to='system.Dict', verbose_name='劳务费级别')),
                ('pro_title', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='userdetail_pro_title', to='system.Dict', verbose_name='职称')),
                ('region', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='userdetail_region', to='system.Dict', verbose_name='省市区')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='userdetail_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'verbose_name': '人员详细信息',
                'verbose_name_plural': '人员详细信息',
            },
        ),
        migrations.CreateModel(
            name='Train',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('name', models.CharField(max_length=200, verbose_name='培训主题')),
                ('start_time', models.DateTimeField(verbose_name='开始时间')),
                ('end_time', models.DateTimeField(verbose_name='结束时间')),
                ('hours', models.IntegerField(default=1, verbose_name='学时')),
                ('train_org', models.CharField(max_length=200, verbose_name='培训机构')),
                ('teacher', models.CharField(max_length=200, verbose_name='主讲人')),
                ('content', models.TextField(verbose_name='培训内容')),
                ('remark', models.TextField(verbose_name='备注')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='train_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('employees', models.ManyToManyField(related_name='train_employees', to=settings.AUTH_USER_MODEL, verbose_name='参加人员')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='train_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'verbose_name': '培训记录',
                'verbose_name_plural': '培训记录',
            },
        ),
        migrations.CreateModel(
            name='Qualification',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('cert_number', models.CharField(max_length=200, unique=True, verbose_name='证书号')),
                ('registration_date', models.DateField(verbose_name='注册日期')),
                ('expiration_date', models.DateField(verbose_name='到期日期')),
                ('publish_number', models.CharField(max_length=200, unique=True, verbose_name='文号')),
                ('remark', models.TextField(verbose_name='备注')),
                ('is_paused', models.BooleanField(default=False, verbose_name='是否暂停')),
                ('auditor_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='qualification_auditor_type', to='system.Dict', verbose_name='资格类型')),
                ('cert_field', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='qualification_cert_field', to='system.Dict', verbose_name='认证领域')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='qualification_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('employee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='qualification_employee', to=settings.AUTH_USER_MODEL)),
                ('major_rules', models.ManyToManyField(through='employee.Ability', to='certset.ImplementRule', verbose_name='注册专业(ccc)')),
                ('majors', models.ManyToManyField(through='employee.Ability', to='system.Dict', verbose_name='注册专业')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='qualification_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'verbose_name': '注册资格',
                'verbose_name_plural': '注册资格',
            },
        ),
        migrations.CreateModel(
            name='HistoricalQualification',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(blank=True, editable=False, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('cert_number', models.CharField(db_index=True, max_length=200, verbose_name='证书号')),
                ('registration_date', models.DateField(verbose_name='注册日期')),
                ('expiration_date', models.DateField(verbose_name='到期日期')),
                ('publish_number', models.CharField(db_index=True, max_length=200, verbose_name='文号')),
                ('remark', models.TextField(verbose_name='备注')),
                ('is_paused', models.BooleanField(default=False, verbose_name='是否暂停')),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('auditor_type', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='system.Dict', verbose_name='资格类型')),
                ('cert_field', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='system.Dict', verbose_name='认证领域')),
                ('create_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('employee', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('update_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'verbose_name': 'historical 注册资格',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalAbility',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(blank=True, editable=False, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('access_date', models.DateField(verbose_name='评定时间')),
                ('remark', models.TextField(verbose_name='备注')),
                ('is_paused', models.BooleanField(default=False, verbose_name='是否暂停')),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('afrom', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='system.Dict', verbose_name='能力来源')),
                ('cert_field', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='system.Dict', verbose_name='认证领域')),
                ('create_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('employee', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('major', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='system.Dict', verbose_name='专业代码')),
                ('major_rule', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='certset.ImplementRule', verbose_name='专业(ccc)')),
                ('qualification', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='employee.Qualification')),
                ('update_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'verbose_name': 'historical 专业能力',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='Education',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('admission_date', models.DateField(verbose_name='入学时间')),
                ('graduation_date', models.DateField(verbose_name='毕业时间')),
                ('school', models.CharField(max_length=200, verbose_name='毕业院校')),
                ('major', models.CharField(max_length=200, verbose_name='所学专业')),
                ('remark', models.TextField(verbose_name='备注')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='education_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('employee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='education_employee', to=settings.AUTH_USER_MODEL)),
                ('level', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='education_level', to='system.Dict', verbose_name='文化程度')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='education_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'verbose_name': '教育经历',
                'verbose_name_plural': '教育经历',
            },
        ),
        migrations.AddField(
            model_name='ability',
            name='qualification',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ability_qualification', to='employee.Qualification'),
        ),
        migrations.AddField(
            model_name='ability',
            name='update_by',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ability_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人'),
        ),
    ]
