# Generated by Django 3.1.4 on 2021-03-04 13:35

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


class Migration(migrations.Migration):

    dependencies = [
        ('company', '0172_department'),
    ]

    operations = [
        migrations.CreateModel(
            name='Position',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, verbose_name='职务名称')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='company.company', verbose_name='公司名称')),
            ],
            options={
                'verbose_name': '岗位职务',
                'verbose_name_plural': '岗位职务',
            },
        ),
        migrations.AddField(
            model_name='department',
            name='division',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='department_division', to='company.salesdivision', verbose_name='营销大区'),
        ),
        migrations.AddField(
            model_name='department',
            name='is_headquater',
            field=models.SmallIntegerField(choices=[(0, '否'), (1, '是')], default=1, verbose_name='总部部门'),
        ),
        migrations.AddField(
            model_name='department',
            name='parent',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='company.department', verbose_name='上级部门'),
        ),
        migrations.AddField(
            model_name='department',
            name='sub_division',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='department_division', to='company.subsaldivision', verbose_name='营销分区'),
        ),
        migrations.AlterField(
            model_name='department',
            name='sn',
            field=models.SmallIntegerField(blank=True, default=0, null=True, verbose_name='序号'),
        ),
        migrations.CreateModel(
            name='Staff',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, verbose_name='员工姓名')),
                ('cellphone', models.CharField(blank=True, max_length=11, null=True, verbose_name='手机电话')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='staff_company', to='company.company', verbose_name='公司名称')),
                ('department', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='staff_depatment', to='company.department', verbose_name='所属部门')),
                ('position', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='staff_position', to='company.position', verbose_name='岗位职务')),
                ('user', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='登录帐号')),
            ],
            options={
                'verbose_name': '公司员工',
                'verbose_name_plural': '公司员工',
            },
        ),
    ]
