# Generated by Django 2.2.3 on 2019-12-23 16:38

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import utils.validators


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=300)),
                ('description', models.TextField()),
                ('price', models.IntegerField()),
                ('city', models.CharField(max_length=300)),
                ('category', models.CharField(max_length=300)),
                ('color', models.PositiveSmallIntegerField(choices=[(1, 'BLACK'), (2, 'WHITE'), (3, 'RED'), (4, 'GREEN'), (5, 'YELLOW')], default=1)),
                ('creator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Article',
                'verbose_name_plural': 'Articles',
            },
        ),
        migrations.CreateModel(
            name='FavoriteArticle',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Article')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='ArticleImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.FileField(null=True, upload_to='projects/', validators=[utils.validators.article_image_size, utils.validators.article_image_extension])),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Article')),
            ],
            options={
                'verbose_name': 'ArticleImage',
                'verbose_name_plural': 'ArticleImages',
            },
        ),
    ]
