# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-11 12:54
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Hardware',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.PositiveSmallIntegerField()),
                ('mhz', models.PositiveSmallIntegerField()),
                ('family', models.CharField(max_length=75)),
                ('unit', models.CharField(choices=[('GB', 'GB'), ('CO', 'Cores'), ('BP', 'bps')], default='CO', max_length=2)),
            ],
            options={
                'ordering': ('vendor', 'family', 'mhz'),
            },
        ),
        migrations.CreateModel(
            name='Infrastructure',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=75)),
                ('description', models.CharField(max_length=125)),
            ],
            options={
                'ordering': ('name',),
            },
        ),
        migrations.CreateModel(
            name='InfrastructureNode',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.PositiveIntegerField(default=1)),
                ('infrastructure', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='infrastructure.Infrastructure')),
            ],
        ),
        migrations.CreateModel(
            name='Node',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reference', models.CharField(max_length=75)),
                ('size', models.PositiveIntegerField(default=1)),
            ],
        ),
        migrations.CreateModel(
            name='NodeHardware',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.PositiveSmallIntegerField(default=1)),
                ('hardware', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='infrastructure.Hardware')),
                ('node', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='infrastructure.Node')),
            ],
        ),
        migrations.CreateModel(
            name='Resource',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Vendor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=75)),
            ],
        ),
        migrations.AddField(
            model_name='node',
            name='hardware',
            field=models.ManyToManyField(through='infrastructure.NodeHardware', to='infrastructure.Hardware'),
        ),
        migrations.AddField(
            model_name='node',
            name='vendor',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='infrastructure.Vendor'),
        ),
        migrations.AddField(
            model_name='infrastructurenode',
            name='node',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='infrastructure.Node'),
        ),
        migrations.AddField(
            model_name='infrastructure',
            name='nodes',
            field=models.ManyToManyField(through='infrastructure.InfrastructureNode', to='infrastructure.Node'),
        ),
        migrations.AddField(
            model_name='hardware',
            name='resource',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='infrastructure.Resource'),
        ),
        migrations.AddField(
            model_name='hardware',
            name='vendor',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='infrastructure.Vendor'),
        ),
    ]
