# Generated by Django 2.1 on 2019-01-10 18:11

from decimal import Decimal
from django.conf import settings
import django.contrib.auth.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_auto_20181211_2028'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='InternationalTrip',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_country', models.CharField(max_length=60)),
                ('From', models.CharField(max_length=60)),
                ('second_country', models.CharField(max_length=60)),
                ('to', models.CharField(max_length=60)),
                ('fuel_cost', models.DecimalField(decimal_places=2, max_digits=3, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])),
                ('fuel_consumption', models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100)])),
                ('date', models.DateTimeField(auto_now=True)),
                ('distance', models.PositiveIntegerField(default=0, validators=[django.core.validators.MinValueValidator(1)])),
                ('money', models.PositiveIntegerField(default=0, validators=[django.core.validators.MinValueValidator(1)])),
                ('time', models.CharField(max_length=9)),
            ],
            options={
                'ordering': ['-date'],
            },
        ),
        migrations.CreateModel(
            name='Trip',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('country', models.CharField(max_length=60)),
                ('From', models.CharField(max_length=60)),
                ('to', models.CharField(max_length=60)),
                ('fuel_cost', models.DecimalField(decimal_places=2, max_digits=3, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])),
                ('fuel_consumption', models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100)])),
                ('date', models.DateTimeField(auto_now=True)),
                ('distance', models.PositiveIntegerField(default=0, validators=[django.core.validators.MinValueValidator(1)])),
                ('money', models.PositiveIntegerField(default=0, validators=[django.core.validators.MinValueValidator(1)])),
                ('time', models.CharField(max_length=9)),
            ],
            options={
                'ordering': ['-date'],
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('auth.user', models.Model),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.AddField(
            model_name='trip',
            name='user',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='trips', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='internationaltrip',
            name='user',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='international_trips', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterUniqueTogether(
            name='trip',
            unique_together={('From', 'to', 'user')},
        ),
        migrations.AlterUniqueTogether(
            name='internationaltrip',
            unique_together={('From', 'to', 'user')},
        ),
    ]
