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


class Migration(migrations.Migration):

    replaces = [('dcim', '0002_auto_20160622_1821'), ('dcim', '0003_auto_20160628_1721'), ('dcim', '0004_auto_20160701_2049'), ('dcim', '0005_auto_20160706_1722'), ('dcim', '0006_add_device_primary_ip4_ip6'), ('dcim', '0007_device_copy_primary_ip'), ('dcim', '0008_device_remove_primary_ip'), ('dcim', '0009_site_32bit_asn_support'), ('dcim', '0010_devicebay_installed_device_set_null'), ('dcim', '0011_devicetype_part_number'), ('dcim', '0012_site_rack_device_add_tenant'), ('dcim', '0013_add_interface_form_factors'), ('dcim', '0014_rack_add_type_width'), ('dcim', '0015_rack_add_u_height_validator'), ('dcim', '0016_module_add_manufacturer'), ('dcim', '0017_rack_add_role'), ('dcim', '0018_device_add_asset_tag'), ('dcim', '0019_new_iface_form_factors'), ('dcim', '0020_rack_desc_units'), ('dcim', '0021_add_ff_flexstack'), ('dcim', '0022_color_names_to_rgb')]

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

    operations = [
        migrations.AddField(
            model_name='device',
            name='rack',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='devices', to='dcim.Rack'),
        ),
        migrations.AddField(
            model_name='consoleserverporttemplate',
            name='device_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cs_port_templates', to='dcim.DeviceType'),
        ),
        migrations.AddField(
            model_name='consoleserverport',
            name='device',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cs_ports', to='dcim.Device'),
        ),
        migrations.AddField(
            model_name='consoleporttemplate',
            name='device_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='console_port_templates', to='dcim.DeviceType'),
        ),
        migrations.AddField(
            model_name='consoleport',
            name='cs_port',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='connected_console', to='dcim.ConsoleServerPort', verbose_name=b'Console server port'),
        ),
        migrations.AddField(
            model_name='consoleport',
            name='device',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='console_ports', to='dcim.Device'),
        ),
        migrations.AlterUniqueTogether(
            name='rackgroup',
            unique_together=set([('site', 'name'), ('site', 'slug')]),
        ),
        migrations.AlterUniqueTogether(
            name='rack',
            unique_together=set([('site', 'facility_id'), ('site', 'name')]),
        ),
        migrations.AlterUniqueTogether(
            name='powerporttemplate',
            unique_together=set([('device_type', 'name')]),
        ),
        migrations.AlterUniqueTogether(
            name='powerport',
            unique_together=set([('device', 'name')]),
        ),
        migrations.AlterUniqueTogether(
            name='poweroutlettemplate',
            unique_together=set([('device_type', 'name')]),
        ),
        migrations.AlterUniqueTogether(
            name='poweroutlet',
            unique_together=set([('device', 'name')]),
        ),
        migrations.AlterUniqueTogether(
            name='module',
            unique_together=set([('device', 'parent', 'name')]),
        ),
        migrations.AlterUniqueTogether(
            name='interfacetemplate',
            unique_together=set([('device_type', 'name')]),
        ),
        migrations.AddField(
            model_name='interface',
            name='mac_address',
            field=dcim.fields.MACAddressField(blank=True, null=True, verbose_name=b'MAC Address'),
        ),
        migrations.AlterUniqueTogether(
            name='interface',
            unique_together=set([('device', 'name')]),
        ),
        migrations.AddField(
            model_name='devicetype',
            name='subdevice_role',
            field=models.NullBooleanField(choices=[(None, b'None'), (True, b'Parent'), (False, b'Child')], default=None, help_text=b'Parent devices house child devices in device bays. Select "None" if this device type is neither a parent nor a child.', verbose_name=b'Parent/child status'),
        ),
        migrations.AlterUniqueTogether(
            name='devicetype',
            unique_together=set([('manufacturer', 'slug'), ('manufacturer', 'model')]),
        ),
        migrations.AlterUniqueTogether(
            name='device',
            unique_together=set([('rack', 'position', 'face')]),
        ),
        migrations.AlterUniqueTogether(
            name='consoleserverporttemplate',
            unique_together=set([('device_type', 'name')]),
        ),
        migrations.AlterUniqueTogether(
            name='consoleserverport',
            unique_together=set([('device', 'name')]),
        ),
        migrations.AlterUniqueTogether(
            name='consoleporttemplate',
            unique_together=set([('device_type', 'name')]),
        ),
        migrations.AlterUniqueTogether(
            name='consoleport',
            unique_together=set([('device', 'name')]),
        ),
        migrations.CreateModel(
            name='DeviceBay',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name=b'Name')),
                ('device', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='device_bays', to='dcim.Device')),
                ('installed_device', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='parent_bay', to='dcim.Device')),
            ],
            options={
                'ordering': ['device', 'name'],
            },
        ),
        migrations.CreateModel(
            name='DeviceBayTemplate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
                ('device_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='device_bay_templates', to='dcim.DeviceType')),
            ],
            options={
                'ordering': ['device_type', 'name'],
            },
        ),
        migrations.AlterUniqueTogether(
            name='devicebaytemplate',
            unique_together=set([('device_type', 'name')]),
        ),
        migrations.AlterUniqueTogether(
            name='devicebay',
            unique_together=set([('device', 'name')]),
        ),
        migrations.AddField(
            model_name='device',
            name='primary_ip4',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='primary_ip4_for', to='ipam.IPAddress', verbose_name=b'Primary IPv4'),
        ),
        migrations.AddField(
            model_name='device',
            name='primary_ip6',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='primary_ip6_for', to='ipam.IPAddress', verbose_name=b'Primary IPv6'),
        ),
        migrations.AlterField(
            model_name='site',
            name='asn',
            field=dcim.fields.ASNField(blank=True, null=True, verbose_name=b'ASN'),
        ),
        migrations.AlterField(
            model_name='devicebay',
            name='installed_device',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='parent_bay', to='dcim.Device'),
        ),
        migrations.AddField(
            model_name='devicetype',
            name='part_number',
            field=models.CharField(blank=True, help_text=b'Discrete part number (optional)', max_length=50),
        ),
        migrations.AddField(
            model_name='device',
            name='tenant',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='devices', to='tenancy.Tenant'),
        ),
        migrations.AddField(
            model_name='rack',
            name='tenant',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='racks', to='tenancy.Tenant'),
        ),
        migrations.AddField(
            model_name='site',
            name='tenant',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='sites', to='tenancy.Tenant'),
        ),
        migrations.AddField(
            model_name='rack',
            name='type',
            field=models.PositiveSmallIntegerField(blank=True, choices=[(100, b'2-post frame'), (200, b'4-post frame'), (300, b'4-post cabinet'), (1000, b'Wall-mounted frame'), (1100, b'Wall-mounted cabinet')], null=True, verbose_name=b'Type'),
        ),
        migrations.AddField(
            model_name='rack',
            name='width',
            field=models.PositiveSmallIntegerField(choices=[(19, b'19 inches'), (23, b'23 inches')], default=19, help_text=b'Rail-to-rail width', verbose_name=b'Width'),
        ),
        migrations.AlterField(
            model_name='rack',
            name='u_height',
            field=models.PositiveSmallIntegerField(default=42, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100)], verbose_name=b'Height (U)'),
        ),
        migrations.AddField(
            model_name='module',
            name='manufacturer',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='modules', to='dcim.Manufacturer'),
        ),
        migrations.CreateModel(
            name='RackRole',
            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)),
                ('color', utilities.fields.ColorField(max_length=6)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.AddField(
            model_name='rack',
            name='role',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='racks', to='dcim.RackRole'),
        ),
        migrations.AddField(
            model_name='device',
            name='asset_tag',
            field=utilities.fields.NullableCharField(blank=True, help_text=b'A unique tag used to identify this device', max_length=50, null=True, unique=True, verbose_name=b'Asset tag'),
        ),
        migrations.AddField(
            model_name='rack',
            name='desc_units',
            field=models.BooleanField(default=False, help_text=b'Units are numbered top-to-bottom', verbose_name=b'Descending units'),
        ),
        migrations.AlterField(
            model_name='device',
            name='position',
            field=models.PositiveSmallIntegerField(blank=True, help_text=b'The lowest-numbered unit occupied by the device', null=True, validators=[django.core.validators.MinValueValidator(1)], verbose_name=b'Position (U)'),
        ),
        migrations.AlterField(
            model_name='interface',
            name='form_factor',
            field=models.PositiveSmallIntegerField(choices=[[b'Virtual interfaces', [[0, b'Virtual']]], [b'Ethernet (fixed)', [[800, b'100BASE-TX (10/100ME)'], [1000, b'1000BASE-T (1GE)'], [1150, b'10GBASE-T (10GE)']]], [b'Ethernet (modular)', [[1050, b'GBIC (1GE)'], [1100, b'SFP (1GE)'], [1200, b'SFP+ (10GE)'], [1300, b'XFP (10GE)'], [1310, b'XENPAK (10GE)'], [1320, b'X2 (10GE)'], [1350, b'SFP28 (25GE)'], [1400, b'QSFP+ (40GE)'], [1500, b'CFP (100GE)'], [1600, b'QSFP28 (100GE)']]], [b'FibreChannel', [[3010, b'SFP (1GFC)'], [3020, b'SFP (2GFC)'], [3040, b'SFP (4GFC)'], [3080, b'SFP+ (8GFC)'], [3160, b'SFP+ (16GFC)']]], [b'Serial', [[4000, b'T1 (1.544 Mbps)'], [4010, b'E1 (2.048 Mbps)'], [4040, b'T3 (45 Mbps)'], [4050, b'E3 (34 Mbps)']]], [b'Stacking', [[5000, b'Cisco StackWise'], [5050, b'Cisco StackWise Plus'], [5100, b'Cisco FlexStack'], [5150, b'Cisco FlexStack Plus']]], [b'Other', [[32767, b'Other']]]], default=1200),
        ),
        migrations.AlterField(
            model_name='interfacetemplate',
            name='form_factor',
            field=models.PositiveSmallIntegerField(choices=[[b'Virtual interfaces', [[0, b'Virtual']]], [b'Ethernet (fixed)', [[800, b'100BASE-TX (10/100ME)'], [1000, b'1000BASE-T (1GE)'], [1150, b'10GBASE-T (10GE)']]], [b'Ethernet (modular)', [[1050, b'GBIC (1GE)'], [1100, b'SFP (1GE)'], [1200, b'SFP+ (10GE)'], [1300, b'XFP (10GE)'], [1310, b'XENPAK (10GE)'], [1320, b'X2 (10GE)'], [1350, b'SFP28 (25GE)'], [1400, b'QSFP+ (40GE)'], [1500, b'CFP (100GE)'], [1600, b'QSFP28 (100GE)']]], [b'FibreChannel', [[3010, b'SFP (1GFC)'], [3020, b'SFP (2GFC)'], [3040, b'SFP (4GFC)'], [3080, b'SFP+ (8GFC)'], [3160, b'SFP+ (16GFC)']]], [b'Serial', [[4000, b'T1 (1.544 Mbps)'], [4010, b'E1 (2.048 Mbps)'], [4040, b'T3 (45 Mbps)'], [4050, b'E3 (34 Mbps)']]], [b'Stacking', [[5000, b'Cisco StackWise'], [5050, b'Cisco StackWise Plus'], [5100, b'Cisco FlexStack'], [5150, b'Cisco FlexStack Plus']]], [b'Other', [[32767, b'Other']]]], default=1200),
        ),
        migrations.AlterField(
            model_name='devicerole',
            name='color',
            field=utilities.fields.ColorField(max_length=6),
        ),
    ]
