# Generated by Django 3.0.4 on 2020-03-21 14:18

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


class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='Car',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('make', models.CharField(max_length=50, verbose_name='Марка')),
                ('model', models.CharField(max_length=50, verbose_name='Модель')),
                ('color', models.CharField(max_length=30, verbose_name='Цвет')),
                ('state_number', models.IntegerField(verbose_name='Гос номер')),
            ],
        ),
        migrations.CreateModel(
            name='Ownership',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start_date', models.DateField(verbose_name='Дата начала владения')),
                ('end_date', models.DateField(verbose_name='Дата конца владения')),
                ('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.AddField(
            model_name='car',
            name='owner',
            field=models.ManyToManyField(through='project_first_app.Ownership', to='project_first_app.CarOwner'),
        ),
    ]
