<reponame>stephensipos/traktorkereso
# Generated by Django 3.1.3 on 2020-11-17 23:09

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Condition',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.CharField(max_length=200, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Tractor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('make', models.CharField(max_length=200)),
                ('model', models.CharField(max_length=200)),
                ('price', models.DecimalField(decimal_places=2, max_digits=10, null=True)),
                ('year', models.DateField(blank=True, null=True)),
                ('hours', models.IntegerField(blank=True, null=True)),
                ('engine_power', models.IntegerField(blank=True, null=True)),
                ('documents_valid', models.DateField(blank=True, null=True)),
                ('documents_type', models.CharField(blank=True, max_length=200, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('image_url', models.CharField(blank=True, max_length=2000, null=True)),
                ('url', models.CharField(blank=True, max_length=2000, null=True)),
                ('fuel_type', models.CharField(blank=True, max_length=200, null=True)),
                ('condition', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='tractors.condition')),
            ],
        ),
        migrations.CreateModel(
            name='Equipment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('tractor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tractors.tractor')),
            ],
        ),
        migrations.AddConstraint(
            model_name='equipment',
            constraint=models.UniqueConstraint(fields=('tractor', 'name'), name='no duplicates'),
        ),
    ]
