# Generated by Django 2.2.1 on 2019-06-22 06:06

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


class Migration(migrations.Migration):

    dependencies = [
        ('aaaa', '0003_jenkins_data'),
    ]

    operations = [
        migrations.CreateModel(
            name='AppUnit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64, unique=True, verbose_name='应用名称')),
                ('comment', models.CharField(blank=True, max_length=128, null=True, verbose_name='备注')),
            ],
            options={
                'verbose_name': 'APP',
                'verbose_name_plural': 'APP',
            },
        ),
        migrations.CreateModel(
            name='DataCenter',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32, verbose_name='机房区域')),
                ('manufactory', models.SmallIntegerField(choices=[(0, 'UCloud'), (1, 'Aliyun')], default=0, verbose_name='云服务商')),
                ('address', models.CharField(blank=True, max_length=128, null=True, verbose_name='机房地址')),
                ('project_name', models.CharField(max_length=32, verbose_name='所属项目')),
                ('email', models.CharField(blank=True, max_length=32, null=True, verbose_name='邮箱')),
                ('mobile', models.CharField(blank=True, max_length=16, null=True, verbose_name='联系方式')),
                ('comment', models.TextField(blank=True, max_length=256, null=True, verbose_name='备注')),
            ],
            options={
                'verbose_name': '机房区域',
                'verbose_name_plural': '机房区域',
                'unique_together': {('name', 'project_name')},
            },
        ),
        migrations.CreateModel(
            name='Department',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32, unique=True, verbose_name='部门名称')),
                ('comment', models.CharField(blank=True, max_length=128, null=True, verbose_name='备注')),
            ],
            options={
                'verbose_name': '部门',
                'verbose_name_plural': '部门',
            },
        ),
        migrations.CreateModel(
            name='EIP',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32, verbose_name='EIP名称')),
                ('ip_address', models.GenericIPAddressField(protocol='ipv4', unique=True, verbose_name='IP地址')),
                ('bandwidth', models.CharField(max_length=16, verbose_name='带宽(MB)')),
                ('band_status', models.SmallIntegerField(choices=[(0, '已绑定'), (1, '未绑定')], verbose_name='绑定状态')),
                ('comment', models.CharField(blank=True, max_length=256, null=True, verbose_name='备注')),
                ('data_center', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='aaaa.DataCenter', verbose_name='机房区域')),
            ],
            options={
                'verbose_name': 'EIP',
                'verbose_name_plural': 'EIP',
            },
        ),
        migrations.CreateModel(
            name='OsType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32, verbose_name='系统类型')),
                ('version', models.CharField(max_length=32, verbose_name='系统版本')),
            ],
            options={
                'verbose_name': '系统类型',
                'verbose_name_plural': '系统类型',
            },
        ),
        migrations.CreateModel(
            name='ULB',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32, verbose_name='ULB名称')),
                ('base_network', models.GenericIPAddressField(protocol='ipv4', unique=True, verbose_name='基础网络')),
                ('comment', models.CharField(blank=True, max_length=128, null=True, verbose_name='备注')),
                ('data_center', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='aaaa.DataCenter', verbose_name='机房区域')),
                ('eip', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='aaaa.EIP', verbose_name='EIP')),
            ],
            options={
                'verbose_name': 'ULB',
                'verbose_name_plural': 'ULB',
            },
        ),
        migrations.CreateModel(
            name='Hosts',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32, unique=True, verbose_name='主机名称')),
                ('cpu', models.CharField(max_length=8, verbose_name='CPU核数')),
                ('memory', models.CharField(max_length=8, verbose_name='内存大小(MB)')),
                ('disk', models.CharField(max_length=16, verbose_name='磁盘大小(GB)')),
                ('ip_in', models.GenericIPAddressField(protocol='ipv4', unique=True, verbose_name='内网IP')),
                ('ip_out', models.GenericIPAddressField(blank=True, null=True, protocol='ipv4', verbose_name='外网IP')),
                ('host_status', models.SmallIntegerField(choices=[(0, '在线'), (1, '下线'), (2, '空闲')], default=0, verbose_name='状态')),
                ('comment', models.TextField(blank=True, max_length=256, null=True, verbose_name='备注')),
                ('create_date', models.DateTimeField(auto_now_add=True)),
                ('update_date', models.DateTimeField(auto_now=True)),
                ('app_unit', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='aaaa.AppUnit', verbose_name='App应用')),
                ('data_center', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='aaaa.DataCenter', verbose_name='机房区域')),
                ('eip', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='aaaa.EIP')),
                ('os_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='aaaa.OsType', verbose_name='系统类型')),
                ('ulb', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='aaaa.ULB', verbose_name='所属ULB')),
            ],
            options={
                'verbose_name': '主机信息',
                'verbose_name_plural': '主机信息',
            },
        ),
        migrations.CreateModel(
            name='Domain',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('domain', models.CharField(max_length=32, unique=True, verbose_name='域名')),
                ('comment', models.CharField(blank=True, max_length=256, null=True, verbose_name='备注')),
                ('app_unit', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='aaaa.AppUnit', verbose_name='App应用')),
                ('owner', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='aaaa.User', verbose_name='负责人')),
            ],
            options={
                'verbose_name': '域名',
                'verbose_name_plural': '域名',
            },
        ),
        migrations.CreateModel(
            name='BusinessUnit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64, unique=True, verbose_name='业务线')),
                ('comment', models.CharField(blank=True, max_length=128, null=True, verbose_name='备注')),
                ('owner', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='aaaa.User', verbose_name='负责人')),
            ],
            options={
                'verbose_name': '业务线',
                'verbose_name_plural': '业务线',
            },
        ),
        migrations.AddField(
            model_name='appunit',
            name='business_unit',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='aaaa.BusinessUnit', verbose_name='所属业务线'),
        ),
        migrations.AddField(
            model_name='appunit',
            name='owner',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='aaaa.User', verbose_name='应用负责人'),
        ),
    ]
