# Generated by Django 2.1.5 on 2019-01-05 19:54

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


class Migration(migrations.Migration):

    replaces = [('assets', '0006_auto_20180728_1451'), ('assets', '0007_auto_20181215_1447'), ('assets', '0008_auto_20181215_1448'), ('assets', '0009_auto_20181215_1640'), ('assets', '0010_auto_20181215_1640'), ('assets', '0011_auto_20181215_1749'), ('assets', '0012_auto_20181215_1813'), ('assets', '0013_asset_parent'), ('assets', '0014_auto_20190103_1615'), ('assets', '0015_auto_20190103_1617'), ('assets', '0016_remove_asset_collection'), ('assets', '0017_delete_collection'), ('assets', '0018_auto_20190103_1708'), ('assets', '0019_auto_20190103_1723'), ('assets', '0020_auto_20190103_1729'), ('assets', '0021_auto_20190105_1156')]

    dependencies = [
        ('assets', '0005_auto_20180301_1725'),
    ]

    operations = [
        migrations.AlterField(
            model_name='asset',
            name='asset_id',
            field=models.IntegerField(blank=True, null=True, unique=True),
        ),
        migrations.AlterField(
            model_name='asset',
            name='purchase_price',
            field=models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True),
        ),
        migrations.AlterField(
            model_name='asset',
            name='salvage_value',
            field=models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True),
        ),
        migrations.AlterField(
            model_name='asset',
            name='asset_id',
            field=models.IntegerField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='asset',
            name='is_cable',
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name='asset',
            name='length',
            field=models.DecimalField(blank=True, decimal_places=1, max_digits=10, null=True),
        ),
        migrations.AlterField(
            model_name='asset',
            name='asset_id',
            field=models.CharField(blank=True, max_length=10, null=True),
        ),
        migrations.AlterField(
            model_name='asset',
            name='asset_id',
            field=models.CharField(default='', max_length=10),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='asset',
            name='parent',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='asset_parent', to='assets.Asset'),
        ),
        migrations.RemoveField(
            model_name='asset',
            name='collection',
        ),
        migrations.DeleteModel(
            name='Collection',
        ),
        migrations.CreateModel(
            name='Cable',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('asset_id', models.CharField(max_length=10)),
                ('description', models.CharField(max_length=120)),
                ('serial_number', models.CharField(blank=True, max_length=150, null=True)),
                ('date_acquired', models.DateField()),
                ('date_sold', models.DateField(blank=True, null=True)),
                ('purchase_price', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
                ('salvage_value', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
                ('comments', models.TextField(blank=True, null=True)),
                ('next_sched_maint', models.DateField(blank=True, null=True)),
                ('is_cable', models.BooleanField(default=False)),
                ('length', models.DecimalField(blank=True, decimal_places=1, help_text='m', max_digits=10, null=True)),
                ('csa', models.DecimalField(blank=True, decimal_places=2, help_text='mm^2', max_digits=10, null=True)),
                ('circuits', models.IntegerField(blank=True, null=True)),
                ('cores', models.IntegerField(blank=True, null=True)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assets.AssetCategory')),
                ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='asset_parent', to='assets.Cable')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Connector',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.CharField(max_length=80)),
                ('current_rating', models.DecimalField(decimal_places=2, help_text='Amps', max_digits=10)),
                ('voltage_rating', models.IntegerField(default=0, help_text='Volts')),
                ('num_pins', models.IntegerField(blank=True, null=True)),
            ],
        ),
        migrations.AddField(
            model_name='cable',
            name='plug',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='plug', to='assets.Connector'),
        ),
        migrations.AddField(
            model_name='cable',
            name='purchased_from',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='assets.Supplier'),
        ),
        migrations.AddField(
            model_name='cable',
            name='socket',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='socket', to='assets.Connector'),
        ),
        migrations.AddField(
            model_name='cable',
            name='status',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assets.AssetStatus'),
        ),
        migrations.AlterField(
            model_name='asset',
            name='comments',
            field=models.TextField(blank=True, default=''),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='asset',
            name='serial_number',
            field=models.CharField(blank=True, default='', max_length=150),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='cable',
            name='comments',
            field=models.TextField(blank=True, default=''),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='cable',
            name='serial_number',
            field=models.CharField(blank=True, default='', max_length=150),
            preserve_default=False,
        ),
    ]
