# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-16 02:37
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        ('cmdb', '0004_groups_comment'),
    ]

    operations = [
        migrations.CreateModel(
            name='Asset',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ip', models.CharField(blank=True, max_length=32, null=True, verbose_name='主机IP')),
                ('hostname', models.CharField(max_length=128, unique=True, verbose_name='主机名')),
                ('port', models.IntegerField(blank=True, null=True, verbose_name='端口号')),
                ('mac', models.CharField(blank=True, max_length=20, null=True, verbose_name='MAC地址')),
                ('remote_ip', models.CharField(blank=True, max_length=16, null=True, verbose_name='远控卡IP')),
                ('brand', models.CharField(blank=True, max_length=64, null=True, verbose_name='硬件厂商型号')),
                ('cpu', models.CharField(blank=True, max_length=64, null=True, verbose_name='CPU')),
                ('memory', models.CharField(blank=True, max_length=128, null=True, verbose_name='内存')),
                ('disk', models.CharField(blank=True, max_length=1024, null=True, verbose_name='硬盘')),
                ('system_type', models.CharField(blank=True, max_length=32, null=True, verbose_name='系统类型')),
                ('system_version', models.CharField(blank=True, max_length=8, null=True, verbose_name='系统版本号')),
                ('system_arch', models.CharField(blank=True, max_length=16, null=True, verbose_name='系统平台')),
                ('cabinet', models.CharField(blank=True, max_length=32, null=True, verbose_name='机柜号')),
                ('position', models.IntegerField(blank=True, null=True, verbose_name='机器位置')),
                ('number', models.CharField(blank=True, max_length=32, null=True, verbose_name='资产编号')),
                ('status', models.IntegerField(blank=True, choices=[(1, '已使用'), (2, '未使用'), (3, '报废')], default=1, null=True, verbose_name='机器状态')),
                ('asset_type', models.IntegerField(blank=True, choices=[(1, '物理机'), (2, '虚拟机'), (3, '交换机'), (4, '路由器'), (5, '防火墙'), (6, 'Docker'), (7, '其他')], null=True, verbose_name='主机类型')),
                ('env', models.IntegerField(blank=True, choices=[(1, '生产环境'), (2, '测试环境')], null=True, verbose_name='运行环境')),
                ('sn', models.CharField(blank=True, max_length=128, null=True, verbose_name='SN编号')),
                ('date_added', models.DateTimeField(auto_now=True, null=True)),
                ('is_active', models.BooleanField(default=True, verbose_name='是否激活')),
                ('comment', models.CharField(blank=True, max_length=128, null=True, verbose_name='备注')),
            ],
        ),
        migrations.CreateModel(
            name='AssetGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=80, unique=True)),
                ('comment', models.CharField(blank=True, max_length=160, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='IDC',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32, verbose_name='机房名称')),
                ('bandwidth', models.CharField(blank=True, default='', max_length=32, null=True, verbose_name='机房带宽')),
                ('linkman', models.CharField(blank=True, default='', max_length=16, null=True, verbose_name='联系人')),
                ('phone', models.CharField(blank=True, default='', max_length=32, null=True, verbose_name='联系电话')),
                ('address', models.CharField(blank=True, default='', max_length=128, null=True, verbose_name='机房地址')),
                ('network', models.TextField(blank=True, default='', null=True, verbose_name='IP地址段')),
                ('date_added', models.DateField(auto_now=True, null=True)),
                ('operator', models.CharField(blank=True, default='', max_length=32, null=True, verbose_name='运营商')),
                ('comment', models.CharField(blank=True, default='', max_length=128, null=True, verbose_name='备注')),
            ],
            options={
                'verbose_name': 'IDC机房',
                'verbose_name_plural': 'IDC机房',
            },
        ),
        migrations.RemoveField(
            model_name='group',
            name='members',
        ),
        migrations.RemoveField(
            model_name='groups',
            name='host',
        ),
        migrations.RemoveField(
            model_name='membership',
            name='group',
        ),
        migrations.RemoveField(
            model_name='membership',
            name='inviter',
        ),
        migrations.RemoveField(
            model_name='membership',
            name='person',
        ),
        migrations.DeleteModel(
            name='Group',
        ),
        migrations.DeleteModel(
            name='Groups',
        ),
        migrations.DeleteModel(
            name='Host',
        ),
        migrations.DeleteModel(
            name='Membership',
        ),
        migrations.DeleteModel(
            name='Person',
        ),
        migrations.AddField(
            model_name='asset',
            name='group',
            field=models.ManyToManyField(blank=True, to='cmdb.AssetGroup', verbose_name='所属主机组'),
        ),
        migrations.AddField(
            model_name='asset',
            name='idc',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='cmdb.IDC', verbose_name='机房'),
        ),
    ]
