# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-10 07:12
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('client', '0001_initial'),
        ('storage', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Ticket',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('admission_date', models.DateTimeField(auto_now_add=True)),
                ('discharge_date', models.DateTimeField(null=True)),
                ('problem', models.TextField(max_length=400, null=True)),
                ('diagnosis', models.TextField(max_length=600, null=True)),
                ('client', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tickets', to='client.Client')),
                ('device', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tickets', to='client.Device')),
            ],
        ),
        migrations.CreateModel(
            name='TicketStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.CharField(max_length=20, unique=True)),
                ('label', models.CharField(blank=True, default='', max_length=30)),
            ],
        ),
        migrations.AddField(
            model_name='ticket',
            name='status',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tickets', to='ticket.TicketStatus'),
        ),
        migrations.AddField(
            model_name='ticket',
            name='used_parts',
            field=models.ManyToManyField(null=True, related_name='tickets', to='storage.Part'),
        ),
    ]
