# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-07-31 02:25
import dcim.fields
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    replaces = [('circuits', '0001_initial'), ('circuits', '0002_auto_20160622_1821'), ('circuits', '0003_provider_32bit_asn_support'), ('circuits', '0004_circuit_add_tenant'), ('circuits', '0005_circuit_add_upstream_speed'), ('circuits', '0006_terminations'), ('circuits', '0007_circuit_add_description'), ('circuits', '0008_circuittermination_interface_protect_on_delete'), ('circuits', '0009_unicode_literals'), ('circuits', '0010_circuit_status')]

    dependencies = [
        ('dcim', '0001_initial'),
        ('dcim', '0022_color_names_to_rgb'),
        ('tenancy', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Provider',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateField(auto_now_add=True)),
                ('last_updated', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=50, unique=True)),
                ('slug', models.SlugField(unique=True)),
                ('asn', dcim.fields.ASNField(blank=True, null=True, verbose_name='ASN')),
                ('account', models.CharField(blank=True, max_length=30, verbose_name='Account number')),
                ('portal_url', models.URLField(blank=True, verbose_name='Portal')),
                ('noc_contact', models.TextField(blank=True, verbose_name='NOC contact')),
                ('admin_contact', models.TextField(blank=True, verbose_name='Admin contact')),
                ('comments', models.TextField(blank=True)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='CircuitType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True)),
                ('slug', models.SlugField(unique=True)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Circuit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateField(auto_now_add=True)),
                ('last_updated', models.DateTimeField(auto_now=True)),
                ('cid', models.CharField(max_length=50, verbose_name='Circuit ID')),
                ('install_date', models.DateField(blank=True, null=True, verbose_name='Date installed')),
                ('commit_rate', models.PositiveIntegerField(blank=True, null=True, verbose_name='Commit rate (Kbps)')),
                ('comments', models.TextField(blank=True)),
                ('provider', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='circuits', to='circuits.Provider')),
                ('type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='circuits', to='circuits.CircuitType')),
                ('tenant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='circuits', to='tenancy.Tenant')),
                ('description', models.CharField(blank=True, max_length=100)),
                ('status', models.PositiveSmallIntegerField(choices=[[2, 'Planned'], [3, 'Provisioning'], [1, 'Active'], [4, 'Offline'], [0, 'Deprovisioning'], [5, 'Decommissioned']], default=1))
            ],
            options={
                'ordering': ['provider', 'cid'],
            },
        ),
        migrations.AlterUniqueTogether(
            name='circuit',
            unique_together=set([('provider', 'cid')]),
        ),
        migrations.CreateModel(
            name='CircuitTermination',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('term_side', models.CharField(choices=[('A', 'A'), ('Z', 'Z')], max_length=1, verbose_name='Termination')),
                ('port_speed', models.PositiveIntegerField(verbose_name='Port speed (Kbps)')),
                ('upstream_speed', models.PositiveIntegerField(blank=True, help_text='Upstream speed, if different from port speed', null=True, verbose_name='Upstream speed (Kbps)')),
                ('xconnect_id', models.CharField(blank=True, max_length=50, verbose_name='Cross-connect ID')),
                ('pp_info', models.CharField(blank=True, max_length=100, verbose_name='Patch panel/port(s)')),
                ('circuit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='terminations', to='circuits.Circuit')),
                ('interface', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='circuit_termination', to='dcim.Interface')),
                ('site', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='circuit_terminations', to='dcim.Site')),
            ],
            options={
                'ordering': ['circuit', 'term_side'],
            },
        ),
        migrations.AlterUniqueTogether(
            name='circuittermination',
            unique_together=set([('circuit', 'term_side')]),
        ),
    ]
