# Generated by Django 3.1.3 on 2021-04-01 07:34

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('username', models.CharField(max_length=100)),
                ('password', models.CharField(max_length=256)),
                ('first_name', models.CharField(max_length=256)),
                ('last_name', models.CharField(max_length=256)),
                ('photo', models.ImageField(null=True, upload_to='')),
                ('birthday', models.DateField(null=True)),
                ('primary_activity', models.CharField(max_length=150, null=True)),
                ('phone_number', models.IntegerField(null=True)),
                ('points', models.IntegerField(default=0, validators=[barter.validators.non_negative_validator])),
            ],
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=50)),
                ('description', models.TextField()),
                ('price', models.IntegerField(validators=[barter.validators.non_negative_validator])),
                ('status', models.CharField(choices=[('Новый', 'Новый'), ('Ожидает подтверждение', 'Ожидает подтверждение'), ('Подтверждён', 'Подтверждён'), ('Исполнен', 'Исполнен')], max_length=21)),
                ('category', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='barter.category')),
                ('customer', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='customer', to='barter.profile')),
                ('executor', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='executor', to='barter.profile')),
            ],
        ),
        migrations.CreateModel(
            name='Rating',
            fields=[
                ('profile', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='barter.profile')),
                ('rating_as_customer', models.FloatField(default=5.0)),
                ('rating_as_executor', models.FloatField(default=5.0)),
            ],
        ),
        migrations.CreateModel(
            name='TaskAddress',
            fields=[
                ('country', models.CharField(max_length=50)),
                ('city', models.CharField(max_length=50)),
                ('street', models.CharField(max_length=50)),
                ('house', models.CharField(max_length=6)),
                ('room', models.IntegerField()),
                ('latitude', models.FloatField(blank=True, null=True)),
                ('longitude', models.FloatField(blank=True, null=True)),
                ('task', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='barter.task')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='UserAddress',
            fields=[
                ('country', models.CharField(max_length=50)),
                ('city', models.CharField(max_length=50)),
                ('street', models.CharField(max_length=50)),
                ('house', models.CharField(max_length=6)),
                ('room', models.IntegerField()),
                ('latitude', models.FloatField(blank=True, null=True)),
                ('longitude', models.FloatField(blank=True, null=True)),
                ('profile', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='barter.profile')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('task', models.ManyToManyField(to='barter.Task')),
            ],
        ),
        migrations.CreateModel(
            name='Review',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('review_date', models.DateTimeField()),
                ('review_text', models.TextField()),
                ('status_to', models.CharField(choices=[('Новый', 'Новый'), ('Ожидает подтверждение', 'Ожидает подтверждение'), ('Подтверждён', 'Подтверждён'), ('Исполнен', 'Исполнен')], max_length=21)),
                ('from_user', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, related_name='from_user', to='barter.profile')),
                ('task', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='barter.task')),
                ('to_user', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, related_name='to_user', to='barter.profile')),
            ],
        ),
    ]
