# Generated by Django 3.0.5 on 2020-04-30 09:56

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


class Migration(migrations.Migration):

    dependencies = [
        ('autos', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Automobile',
            fields=[
                ('car_make', models.CharField(max_length=50)),
                ('car_model', models.CharField(max_length=50)),
                ('car_color', models.CharField(max_length=50)),
                ('id_car', models.CharField(max_length=50, primary_key=True, serialize=False)),
            ],
        ),
        migrations.CreateModel(
            name='Owning',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_of_start_owning', models.DateField()),
                ('date_of_end_owning', models.DateField()),
                ('car', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='autos.Automobile')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='DriverLicense',
            fields=[
                ('id_license', models.CharField(max_length=50, primary_key=True, serialize=False)),
                ('date_of_issue', models.DateField()),
                ('category', models.CharField(blank=True, choices=[('A', 'A'), ('A1', 'A1'), ('B', 'B'), ('B1', 'B1'), ('C', 'C')], max_length=2)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='user',
            name='autos',
            field=models.ManyToManyField(through='autos.Owning', to='autos.Automobile'),
        ),
    ]
