# Generated by Django 3.1.1 on 2020-10-26 18:55

import GPanneReparation.models
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('GInterventionReclamation', '0001_initial'),
        ('GProduit', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Panne',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(default=django.utils.timezone.now)),
                ('quantite', models.IntegerField()),
                ('produit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='GProduit.produit')),
                ('reclamation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='GInterventionReclamation.reclamation')),
            ],
        ),
        migrations.CreateModel(
            name='Piece',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reference', models.CharField(max_length=255, unique=True)),
                ('libelle', models.CharField(max_length=255)),
                ('prix_unitaire', models.FloatField()),
                ('image', models.ImageField(blank=True, upload_to=GPanneReparation.models.content_file_name)),
            ],
        ),
        migrations.CreateModel(
            name='Reparation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_debut', models.DateField(default=django.utils.timezone.now)),
                ('date_fin', models.DateField(blank=True, null=True)),
                ('motif', models.TextField(blank=True, null=True)),
                ('intervention', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='GInterventionReclamation.intervention')),
                ('panne_concerne', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='GPanneReparation.panne', verbose_name='Panne concerné')),
                ('pieces', models.ManyToManyField(blank=True, to='GPanneReparation.Piece')),
            ],
        ),
    ]
