# Generated by Django 2.2 on 2020-01-13 13:20

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='CSP',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('csp_type', models.CharField(choices=[('AliCloud', '阿里云'), ('AWS', '亚马逊云'), ('Azure', '微软云')], default='aliCloud', max_length=20, verbose_name='云服务供应商')),
            ],
            options={
                'verbose_name': '云服务供应商',
                'verbose_name_plural': '云服务供应商',
            },
        ),
        migrations.CreateModel(
            name='OSType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('OSType', models.CharField(choices=[('Windows', 'Windows'), ('Linux', 'Linux')], default='Linux', max_length=20, verbose_name='操作系统类型')),
                ('OSVersion', models.CharField(blank=True, max_length=64, null=True, unique=True, verbose_name='操作系统版本')),
            ],
            options={
                'verbose_name': '操作系统类型',
                'verbose_name_plural': '操作系统类型',
            },
        ),
        migrations.CreateModel(
            name='Owner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('OwnerName', models.CharField(max_length=30, verbose_name='Owner_Name')),
                ('OwnerNum', models.CharField(max_length=7, verbose_name='Owner_Num')),
            ],
            options={
                'verbose_name': '负责人',
                'verbose_name_plural': '负责人',
            },
        ),
        migrations.CreateModel(
            name='Port',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('PortNum', models.IntegerField(verbose_name='端口号')),
            ],
            options={
                'verbose_name': '端口列表',
                'verbose_name_plural': '端口列表',
            },
        ),
        migrations.CreateModel(
            name='Server',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ServerName', models.CharField(blank=True, max_length=64, null=True, verbose_name='服务器名称')),
                ('PublicIP', models.GenericIPAddressField(blank=True, null=True, protocol='IPv4', verbose_name='公网IPV4地址')),
                ('PrivateIP', models.GenericIPAddressField(blank=True, null=True, protocol='IPv4', verbose_name='私网IPV4地址')),
                ('CSPID', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='assets.CSP', verbose_name='云服务供应商')),
                ('OSTID', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='assets.OSType', verbose_name='操作系统类型')),
                ('OwnerID', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='assets.Owner', verbose_name='负责人')),
            ],
            options={
                'verbose_name': '服务器列表',
                'verbose_name_plural': '服务器列表',
            },
        ),
        migrations.CreateModel(
            name='Service',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ServiceName', models.CharField(max_length=64, verbose_name='服务名称')),
            ],
            options={
                'verbose_name': '服务列表',
                'verbose_name_plural': '服务列表',
            },
        ),
        migrations.CreateModel(
            name='ServerPort',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('PID', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='assets.Port', verbose_name='端口')),
                ('SCID', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='assets.Service', verbose_name='Service')),
                ('SID', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='assets.Server', verbose_name='Server')),
            ],
            options={
                'verbose_name': '服务器端口',
                'verbose_name_plural': '服务器端口',
            },
        ),
    ]
