# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-10-21 13:13
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('datalive_cust_veh', '0003_auto_20171004_1256'),
    ]

    operations = [
        migrations.CreateModel(
            name='Defect',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('creation_datetime', models.DateTimeField(auto_now_add=True)),
                ('registration', models.CharField(db_index=True, max_length=20)),
                ('customer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='datalive_cust_veh.Customer')),
                ('depot', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='datalive_cust_veh.VehicleGroup')),
            ],
        ),
        migrations.CreateModel(
            name='DefectSettings',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('send_confirmation_email', models.BooleanField(default=False)),
                ('confirmation_email', models.EmailField(max_length=256)),
                ('post_to_solar_vista', models.BooleanField(default=False)),
                ('solar_vista_host', models.CharField(max_length=100)),
                ('solar_vista_path', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Equipment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('creation_datetime', models.DateTimeField(auto_now_add=True)),
                ('name', models.CharField(db_index=True, max_length=200)),
                ('description', models.TextField()),
                ('solar_vista_ref', models.IntegerField(null=True)),
                ('customer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='datalive_cust_veh.Customer')),
                ('depot', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='datalive_cust_veh.VehicleGroup')),
            ],
        ),
        migrations.CreateModel(
            name='EquipmentFault',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=200)),
                ('description', models.TextField()),
                ('solar_vista_ref', models.IntegerField(null=True)),
                ('equipment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='datalive_defects.Equipment')),
            ],
        ),
        migrations.AddField(
            model_name='defect',
            name='faults',
            field=models.ManyToManyField(to='datalive_defects.EquipmentFault'),
        ),
        migrations.AddField(
            model_name='defect',
            name='user',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
        ),
    ]
