# Generated by Django 2.1.3 on 2020-04-13 14:46

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_id', models.CharField(max_length=12, verbose_name='业务填写人id')),
                ('name', models.CharField(max_length=50, verbose_name='客户名称')),
                ('contact', models.CharField(max_length=20, verbose_name='联系人')),
                ('tel', models.CharField(max_length=20, verbose_name='联系方式')),
                ('project_name', models.CharField(max_length=50, verbose_name='项目名称')),
                ('project_date', models.DateField(verbose_name='项目签订时间')),
                ('project_amount', models.CharField(max_length=20, verbose_name='项目金额')),
                ('payment_method', models.CharField(max_length=20, verbose_name='付款方式')),
                ('mark', models.TextField(default='无', max_length=1000, verbose_name='项目技术要求或主要条款')),
            ],
            options={
                'verbose_name_plural': '客户信息',
                'db_table': 'Customer',
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='CustomerTracking',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('track_date', models.DateField(verbose_name='跟踪时间记录')),
                ('track_state', models.CharField(max_length=50, verbose_name='项目跟踪状态')),
                ('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='BPlan.Customer', verbose_name='客户')),
            ],
            options={
                'verbose_name_plural': '客户跟踪状态',
                'db_table': 'CustomerTracking',
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='Inventory',
            fields=[
                ('inventory_id', models.BigAutoField(max_length=12, primary_key=True, serialize=False, verbose_name='编号')),
                ('inventory_name', models.CharField(max_length=20, verbose_name='名称')),
                ('inventory_num', models.PositiveIntegerField(verbose_name='数量')),
                ('inventory_unit', models.CharField(default='个', max_length=12, verbose_name='单位')),
                ('inventory_specification', models.CharField(max_length=50, verbose_name='规格')),
                ('inventory_mark', models.CharField(default='无', max_length=300, verbose_name='备注')),
                ('inventory_create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('inventory_recent_change_time', models.DateTimeField(auto_now=True, verbose_name='最近修改时间')),
            ],
            options={
                'verbose_name_plural': '库存',
                'db_table': 'Inventory',
                'ordering': ['inventory_id'],
            },
        ),
        migrations.CreateModel(
            name='InventoryGroup',
            fields=[
                ('auto_id', models.BigAutoField(primary_key=True, serialize=False, verbose_name='组编号')),
                ('name', models.CharField(max_length=20, verbose_name='组名称')),
            ],
            options={
                'verbose_name_plural': '库存的组',
                'db_table': 'InventoryGroup',
                'ordering': ['auto_id'],
            },
        ),
        migrations.CreateModel(
            name='InventoryOperation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('inventory_operation_create_date', models.DateField(auto_now_add=True, verbose_name='操作日期')),
                ('inventory_operation_create_time', models.DateTimeField(auto_now_add=True, verbose_name='操作时间')),
                ('inventory_operation_user_ip', models.GenericIPAddressField(verbose_name='操作者ip')),
                ('inventory_operation_user_browser', models.CharField(default='未知的浏览器', max_length=30, verbose_name='浏览器')),
                ('inventory_operation_user_system', models.CharField(default='未知的系统', max_length=30, verbose_name='操作系统')),
                ('inventory_operation_user_device', models.CharField(default='未知的设备', max_length=30, verbose_name='设备')),
                ('inventory_operation_category', models.PositiveSmallIntegerField(choices=[(0, '入库'), (1, '出库'), (2, '创建')], default=0, verbose_name='操作类别')),
                ('inventory_operation_num', models.PositiveIntegerField(verbose_name='操作数量')),
                ('inventory_num', models.PositiveIntegerField(verbose_name='库存余量')),
                ('inventory_operation_object', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='BPlan.Inventory', verbose_name='操作的库存对象')),
            ],
            options={
                'verbose_name_plural': '库存操作',
                'db_table': 'InventoryOperation',
                'ordering': ['-inventory_operation_create_time'],
            },
        ),
        migrations.CreateModel(
            name='LoginRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('login_ip', models.GenericIPAddressField(verbose_name='登录ip')),
                ('login_browser', models.CharField(default='未知的浏览器', max_length=30, verbose_name='浏览器')),
                ('login_system', models.CharField(default='未知的系统', max_length=30, verbose_name='操作系统')),
                ('login_device', models.CharField(default='未知的设备', max_length=30, verbose_name='设备')),
                ('login_date', models.DateField(auto_now_add=True, verbose_name='登录日期')),
                ('login_time', models.DateTimeField(auto_now_add=True, verbose_name='登录时间')),
            ],
            options={
                'verbose_name_plural': '访问记录',
                'db_table': 'LoginRecord',
                'ordering': ['-login_time'],
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_id', models.CharField(max_length=12, verbose_name='用户id')),
                ('user_password', models.CharField(max_length=20, verbose_name='密码')),
                ('user_name', models.CharField(default='保密', max_length=12, verbose_name='姓名')),
                ('user_gender', models.BooleanField(choices=[(True, '男'), (False, '女')], default=True, verbose_name='性别')),
                ('user_identity', models.PositiveSmallIntegerField(choices=[(0, '普通职员'), (1, '管理员')], default=0, verbose_name='身份与权限')),
                ('user_create_time', models.DateTimeField(auto_now_add=True, verbose_name='用户注册时间')),
            ],
            options={
                'verbose_name_plural': '用户',
                'db_table': 'User',
                'ordering': ['id'],
            },
        ),
        migrations.AddField(
            model_name='loginrecord',
            name='login_user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='BPlan.User', verbose_name='用户'),
        ),
        migrations.AddField(
            model_name='inventoryoperation',
            name='inventory_operation_user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='BPlan.User', verbose_name='领用人'),
        ),
        migrations.AddField(
            model_name='inventory',
            name='inventory_create_user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='create_user', to='BPlan.User', verbose_name='创建人'),
        ),
        migrations.AddField(
            model_name='inventory',
            name='inventory_group',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='BPlan.InventoryGroup', verbose_name='分组'),
        ),
        migrations.AddField(
            model_name='inventory',
            name='inventory_recent_change_user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='change_user', to='BPlan.User', verbose_name='最近领用人'),
        ),
    ]
