# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-16 21:05
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='Contact',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(choices=[('team', 'Team'), ('person', 'Person')], max_length=10)),
                ('name', models.CharField(max_length=200, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='ContactMethod',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('method', models.CharField(choices=[('email', 'EMail'), ('phone', 'Telephone'), ('mobile', 'Mobile Phone'), ('web', 'Web')], max_length=10)),
                ('value', models.CharField(max_length=200)),
                ('contact', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='servicecatalog.Contact')),
            ],
        ),
        migrations.CreateModel(
            name='Hardware',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=200, unique=True)),
                ('type', models.CharField(choices=[('lb', 'Loadbalancer'), ('web', 'Web Server'), ('app', 'Application Server'), ('db', 'Database Server'), ('file', 'File Server')], default=None, max_length=10)),
                ('ip', models.GenericIPAddressField(blank=True, null=True)),
                ('depending_on_hardware', models.ManyToManyField(blank=True, default=None, related_name='hardware_on_hardware', to='servicecatalog.Hardware')),
            ],
        ),
        migrations.CreateModel(
            name='Instance',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, default='', max_length=200)),
                ('environment', models.CharField(choices=[('dev', 'Development'), ('inte', 'Integration'), ('qa', 'Quality Assurance'), ('ctest', 'Customer Test'), ('prod', 'Production')], default=None, max_length=10)),
                ('live', models.BooleanField(default=False)),
                ('customer_accesable', models.BooleanField(default=False)),
                ('depending_on', models.ManyToManyField(blank=True, default=None, related_name='_instance_depending_on_+', to='servicecatalog.Instance')),
            ],
        ),
        migrations.CreateModel(
            name='Location',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Module',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=50, unique=True)),
                ('customer_facing', models.BooleanField(default=False)),
                ('depending_on', models.ManyToManyField(blank=True, default=None, to='servicecatalog.Module')),
                ('owners', models.ManyToManyField(blank=True, to='servicecatalog.Contact')),
            ],
        ),
        migrations.AddField(
            model_name='instance',
            name='location',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='servicecatalog.Location'),
        ),
        migrations.AddField(
            model_name='instance',
            name='module',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='servicecatalog.Module'),
        ),
        migrations.AddField(
            model_name='instance',
            name='service_delivery',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='servicecatalog.Contact'),
        ),
        migrations.AddField(
            model_name='hardware',
            name='depending_on_instance',
            field=models.ManyToManyField(blank=True, default=None, related_name='hardware_on_instance', to='servicecatalog.Instance'),
        ),
        migrations.AddField(
            model_name='hardware',
            name='instance',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='belongs_to_instance', to='servicecatalog.Instance'),
        ),
        migrations.AlterUniqueTogether(
            name='instance',
            unique_together=set([('name', 'module', 'environment', 'location')]),
        ),
    ]
