# Generated by Django 2.2.2 on 2019-06-19 09:16

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),
    ]

    operations = [
        migrations.CreateModel(
            name='RoadTrip',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255, verbose_name='titre')),
                ('slug', models.SlugField(max_length=255, unique=True)),
                ('date_start', models.DateField(verbose_name='date de début')),
                ('date_end', models.DateField(blank=True, default=None, null=True, verbose_name='date de fin')),
                ('mileage_start', models.IntegerField(verbose_name='kilométrage de début')),
                ('mileage_end', models.IntegerField(blank=True, default=None, null=True, verbose_name='kilométrage de fin')),
            ],
            options={
                'verbose_name': 'voyage',
            },
        ),
        migrations.CreateModel(
            name='RoadTripEvent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField()),
                ('location', models.CharField(max_length=255, verbose_name='localisation')),
                ('lat', models.DecimalField(decimal_places=6, max_digits=9, verbose_name='latitude')),
                ('lon', models.DecimalField(decimal_places=6, max_digits=9, verbose_name='longitude')),
                ('mileage', models.IntegerField(blank=True, null=True, verbose_name='kilométrage')),
                ('roadtrip', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='events', to='django_roadtrip.RoadTrip', verbose_name='voyage')),
            ],
            options={
                'verbose_name': 'événement',
            },
        ),
        migrations.CreateModel(
            name='RoadTripProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'profil',
            },
        ),
        migrations.CreateModel(
            name='SleepEvent',
            fields=[
                ('roadtripevent_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='django_roadtrip.RoadTripEvent')),
            ],
            options={
                'verbose_name': 'événement : Nuit de sommeil',
                'verbose_name_plural': 'événement : Nuits de sommeil',
            },
            bases=('django_roadtrip.roadtripevent',),
        ),
        migrations.CreateModel(
            name='StopEvent',
            fields=[
                ('roadtripevent_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='django_roadtrip.RoadTripEvent')),
            ],
            options={
                'verbose_name': 'événement : Arrêt',
            },
            bases=('django_roadtrip.roadtripevent',),
        ),
        migrations.CreateModel(
            name='Vehicle',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('brand', models.CharField(max_length=100)),
                ('model', models.CharField(max_length=255)),
                ('tank_capacity', models.FloatField(verbose_name='capacité du réservoir')),
                ('profile', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='vehicles', to='django_roadtrip.RoadTripProfile', verbose_name='profil')),
            ],
            options={
                'verbose_name': 'véhicule',
            },
        ),
        migrations.AddField(
            model_name='roadtrip',
            name='profile',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='django_roadtrip.RoadTripProfile', verbose_name='profil'),
        ),
        migrations.CreateModel(
            name='RefuelEvent',
            fields=[
                ('roadtripevent_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='django_roadtrip.RoadTripEvent')),
                ('amount', models.FloatField(verbose_name='quantité')),
                ('unity_price', models.FloatField(verbose_name="prix de l'unité")),
                ('vehicle', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='refuels', to='django_roadtrip.Vehicle', verbose_name='véhicule')),
            ],
            options={
                'verbose_name': 'événement : Plein de carburant',
                'verbose_name_plural': 'événement : Pleins de carburant',
            },
            bases=('django_roadtrip.roadtripevent',),
        ),
    ]
