# Generated by Django 2.2 on 2020-05-18 12:06

import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='Camera',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
            ],
        ),
        migrations.CreateModel(
            name='Company',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('cname', models.CharField(max_length=256, null=True, verbose_name='公司中文名称')),
                ('ename', models.CharField(max_length=256, null=True, verbose_name='公司英文名称')),
                ('address', models.CharField(max_length=256, null=True, verbose_name='公司地址')),
                ('tel', models.CharField(max_length=256, null=True, verbose_name='公司电话')),
                ('email', models.EmailField(max_length=256, null=True, verbose_name='公司邮箱')),
                ('createtime', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
            ],
        ),
        migrations.CreateModel(
            name='Departmemt',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=256, null=True, verbose_name='部门名称')),
                ('bossid', models.CharField(max_length=256, null=True, verbose_name='部门负责人号码')),
            ],
        ),
        migrations.CreateModel(
            name='MonitorInfomation',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('reporteduser', models.CharField(max_length=32, null=True, verbose_name='被举报人')),
                ('placename', models.CharField(max_length=64, null=True, verbose_name='场地名称')),
                ('placeid', models.CharField(max_length=256, null=True, verbose_name='场地ID')),
                ('createdate', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('reportdate', models.CharField(max_length=32, null=True, verbose_name='举报时间')),
                ('reportuser', models.CharField(max_length=32, null=True, verbose_name='举报人')),
            ],
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=256, null=True, verbose_name='项目名称')),
                ('bossid', models.CharField(max_length=256, null=True, verbose_name='项目负责人')),
                ('address', models.CharField(max_length=256, null=True, verbose_name='项目地址')),
                ('description', models.CharField(max_length=1024, null=True, verbose_name='项目简介')),
                ('begintime', models.DateTimeField(null=True, verbose_name='项目开始时间')),
                ('endtime', models.DateTimeField(null=True, verbose_name='项目结束时间')),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('personid', models.IntegerField(null=True, verbose_name='员工编号')),
                ('idcard', models.CharField(max_length=256, null=True, verbose_name='身份证号码')),
                ('salaryid', models.CharField(max_length=256, null=True, verbose_name='工资卡卡号')),
                ('bank', models.CharField(max_length=256, null=True, verbose_name='工资卡所属银行')),
                ('gender', models.CharField(max_length=10, null=True, verbose_name='性别')),
                ('introducerid', models.IntegerField(default=0, null=True, verbose_name='引入人号码')),
                ('avatar', models.FileField(default='avatars/default.png', null=True, upload_to='avatars/', verbose_name='头像')),
                ('create_time', models.DateTimeField(auto_now_add=True, null=True, verbose_name='创建时间')),
                ('is_firmuser', models.BooleanField(null=True, verbose_name='是否是企业账号')),
                ('company', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app1.Company')),
                ('department', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app1.Departmemt', verbose_name='所属部门')),
            ],
        ),
        migrations.CreateModel(
            name='Userwork',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('workplaceid', models.IntegerField(default=0, null=True, verbose_name='工作场地号码')),
                ('bossid', models.CharField(max_length=256, null=True, verbose_name='责任人号码')),
                ('begintime', models.DateTimeField(null=True, verbose_name='工作开始时间')),
                ('endtime', models.DateTimeField(null=True, verbose_name='工作结束时间')),
            ],
        ),
        migrations.CreateModel(
            name='Usertowork',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app1.User', verbose_name='用户')),
                ('userwork', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app1.Userwork', verbose_name='用户工作')),
            ],
            options={
                'unique_together': {('user', 'userwork')},
            },
        ),
        migrations.CreateModel(
            name='Usertoproject',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('project', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app1.Project', verbose_name='项目')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app1.User', verbose_name='用户')),
            ],
            options={
                'unique_together': {('user', 'project')},
            },
        ),
        migrations.AddField(
            model_name='user',
            name='project',
            field=models.ManyToManyField(through='app1.Usertoproject', to='app1.Project'),
        ),
        migrations.AddField(
            model_name='user',
            name='userwork',
            field=models.ManyToManyField(through='app1.Usertowork', to='app1.Userwork'),
        ),
        migrations.CreateModel(
            name='Salary',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('basicsalary', models.IntegerField(null=True, verbose_name='基本工资')),
                ('performance', models.IntegerField(null=True, verbose_name='绩效')),
                ('publishment', models.IntegerField(null=True, verbose_name='罚款')),
                ('socialsecurity', models.IntegerField(null=True, verbose_name='社保扣款')),
                ('insurances', models.IntegerField(null=True, verbose_name='五险一金')),
                ('tax', models.IntegerField(null=True, verbose_name='税收')),
                ('finalsalary', models.IntegerField(null=True, verbose_name='实发工资')),
                ('belongmonth', models.DateTimeField(null=True, verbose_name='工资归属月')),
                ('releasedata', models.DateTimeField(null=True, verbose_name='发放日期')),
                ('company', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app1.Company')),
                ('user', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='app1.User')),
            ],
        ),
        migrations.CreateModel(
            name='Projectplace',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=256, null=True, verbose_name='场地名称')),
                ('bossid', models.CharField(max_length=256, null=True, verbose_name='责任人')),
                ('address', models.CharField(max_length=256, null=True, verbose_name='场地地址')),
                ('pictures', models.FileField(default='propictures/default.png', upload_to='propictures/', verbose_name='场地照片')),
                ('description', models.CharField(max_length=1024, null=True, verbose_name='场地详情')),
                ('project', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app1.Project')),
            ],
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('createdata', models.DateTimeField(null=True, verbose_name='拍摄时间')),
                ('safenumber', models.IntegerField(default=0, null=True, verbose_name='安全人数')),
                ('dangernumber', models.IntegerField(default=0, null=True, verbose_name='危险人数')),
                ('camera', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app1.Camera')),
                ('projectplace', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app1.Projectplace')),
            ],
        ),
        migrations.AddField(
            model_name='departmemt',
            name='project',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app1.Project', verbose_name='所属项目'),
        ),
        migrations.AddField(
            model_name='camera',
            name='projectplace',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app1.Projectplace'),
        ),
        migrations.CreateModel(
            name='UserLogin',
            fields=[
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=32, null=True, verbose_name='名字')),
                ('createtime', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='app1.User')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
    ]
