# Generated by Django 2.2 on 2020-04-23 06:09

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


class Migration(migrations.Migration):

    dependencies = [
        ('user', '0001_initial'),
        ('asset', '0001_initial'),
        ('stock', '0003_remove_devicein_material'),
    ]

    operations = [
        migrations.CreateModel(
            name='Application',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('attach', models.FileField(blank=True, null=True, upload_to='attachment/%Y/%m/%d', verbose_name='附件')),
                ('check', models.BooleanField(choices=[(True, '已审核'), (False, '未审核')], default=False, verbose_name='是否审核')),
                ('create_date', models.DateTimeField(auto_now_add=True, null=True, verbose_name='创建时间')),
                ('modify_date', models.DateTimeField(auto_now=True, null=True, verbose_name='修改时间')),
                ('description', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注')),
                ('name', models.CharField(db_index=True, max_length=50, null=True)),
                ('status', models.IntegerField(choices=[(1, '已提交'), (2, '已审批'), (3, '已出库'), (4, '已确认')], default=1)),
                ('approve_content', models.CharField(max_length=50, null=True)),
                ('approve_date', models.DateTimeField(null=True)),
                ('confirm_content', models.CharField(max_length=50, null=True)),
                ('confirm_date', models.DateTimeField(null=True)),
                ('applicant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='applicants', to='user.UserProfile')),
                ('approver', models.ManyToManyField(to='user.UserProfile')),
                ('confirmed', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='confirmeds', to='user.UserProfile')),
            ],
            options={
                'verbose_name': '设备申请表',
                'verbose_name_plural': '设备申请表',
                'ordering': ['-modify_date', '-approve_date', '-confirm_date'],
            },
        ),
        migrations.CreateModel(
            name='ApplicationDetail',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('attach', models.FileField(blank=True, null=True, upload_to='attachment/%Y/%m/%d', verbose_name='附件')),
                ('check', models.BooleanField(choices=[(True, '已审核'), (False, '未审核')], default=False, verbose_name='是否审核')),
                ('create_date', models.DateTimeField(auto_now_add=True, null=True, verbose_name='创建时间')),
                ('modify_date', models.DateTimeField(auto_now=True, null=True, verbose_name='修改时间')),
                ('description', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注')),
                ('name', models.CharField(db_index=True, max_length=50, null=True)),
                ('number', models.IntegerField(null=True)),
                ('location', models.CharField(max_length=50, null=True)),
                ('is_device', models.BooleanField(default=True)),
                ('application', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='details', to='stock.Application')),
                ('devices', models.ManyToManyField(to='asset.Device')),
            ],
            options={
                'verbose_name': '申请详情表',
                'verbose_name_plural': '申请详情表',
            },
        ),
    ]
