# Generated by Django 3.1.7 on 2021-04-07 10:58

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='Brand',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Car',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='Color',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Property',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
                ('category', models.CharField(max_length=30)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Picture',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url', models.CharField(max_length=80)),
                ('metadata', models.TextField(null=True)),
                ('position', models.CharField(choices=[], max_length=1, null=True)),
                ('car_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cars.car')),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(max_length=30)),
                ('last_name', models.CharField(max_length=30)),
                ('email', models.CharField(max_length=50)),
                ('phone', models.CharField(max_length=9)),
                ('message', models.TextField(null=True)),
                ('status', models.CharField(choices=[], default='o', max_length=1)),
                ('car_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cars.car')),
            ],
        ),
        migrations.CreateModel(
            name='Model',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
                ('brand_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cars.brand')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='CarProperty',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('price', models.DecimalField(decimal_places=2, max_digits=11, null=True)),
                ('number', models.SmallIntegerField()),
                ('sitting_place', models.IntegerField(null=True)),
                ('engine_power', models.IntegerField(null=True)),
                ('first_registration_date', models.DateField(null=True)),
                ('doors', models.SmallIntegerField(default=4, null=True)),
                ('fuel_type', models.CharField(choices=[], default=None, max_length=1)),
                ('engine_type', models.CharField(choices=[], default=None, max_length=1)),
                ('capacity', models.DecimalField(decimal_places=1, default=None, max_digits=3, null=True)),
                ('gear_case', models.CharField(choices=[], default='m', max_length=1)),
                ('status', models.CharField(choices=[], default='a', max_length=1)),
                ('slug', models.CharField(max_length=100, null=True)),
                ('population_type', models.CharField(choices=[], max_length=1, null=True)),
                ('other', models.TextField(max_length=500, null=True)),
                ('car_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cars.car')),
                ('property_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cars.property')),
            ],
        ),
        migrations.AddField(
            model_name='car',
            name='color_id',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='cars.color'),
        ),
        migrations.AddField(
            model_name='car',
            name='dealer_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='car',
            name='model_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cars.model'),
        ),
    ]
