# Generated by Django 3.1.4 on 2020-12-16 19:29

from django.conf import settings
import django.core.validators
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='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.BooleanField(default=False)),
                ('create_at', models.DateField(auto_now_add=True)),
                ('description', models.TextField(blank=True)),
                ('date', models.DateField()),
                ('total_cost', models.FloatField()),
                ('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='customer_order', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Services',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(max_length=100)),
                ('description', models.TextField()),
                ('image', models.ImageField(upload_to='service/')),
            ],
        ),
        migrations.CreateModel(
            name='SubServices',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('description', models.TextField()),
                ('image', models.ImageField(upload_to='sub_services/')),
                ('cost', models.FloatField()),
                ('service', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='service.services')),
            ],
        ),
        migrations.CreateModel(
            name='OrderPictures',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('pictures', models.ImageField(upload_to='order/')),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='service.order')),
            ],
        ),
        migrations.AddField(
            model_name='order',
            name='service',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sub_service', to='service.subservices'),
        ),
        migrations.AddField(
            model_name='order',
            name='technical',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='technical_order', to=settings.AUTH_USER_MODEL),
        ),
        migrations.CreateModel(
            name='Rating',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rate', models.IntegerField(validators=[django.core.validators.MinLengthValidator(1), django.core.validators.MaxLengthValidator(5)])),
                ('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='customer_rate', to=settings.AUTH_USER_MODEL)),
                ('order', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='customer_rate_order', to='service.order')),
                ('technical', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='technical_rate', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'unique_together': {('customer', 'technical')},
                'index_together': {('customer', 'technical')},
            },
        ),
    ]
