# Generated by Django 3.0.4 on 2020-03-11 15:49

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Car',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('car_make', models.CharField(max_length=128)),
                ('car_model', models.CharField(max_length=128)),
                ('color', models.CharField(max_length=128)),
                ('number_plate', models.CharField(max_length=128)),
            ],
        ),
        migrations.CreateModel(
            name='CarOwner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
                ('surname', models.CharField(max_length=128)),
                ('date_of_birth', models.DateField()),
            ],
        ),
        migrations.CreateModel(
            name='Ownership',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start_date', models.DateField()),
                ('end_date', models.DateField()),
                ('car', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='project_first_app.Car')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='project_first_app.CarOwner')),
            ],
        ),
        migrations.CreateModel(
            name='DriversLicense',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('driver_license_number', models.CharField(max_length=128)),
                ('date_of_issue', models.DateField()),
                ('license_type', models.CharField(choices=[('A', 'Motorcycle'), ('B', 'Car'), ('C', 'Truck')], max_length=1)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='project_first_app.CarOwner')),
            ],
        ),
        migrations.AddField(
            model_name='car',
            name='car_owner',
            field=models.ManyToManyField(through='project_first_app.Ownership', to='project_first_app.CarOwner'),
        ),
    ]
