# Generated by Django 3.2.7 on 2021-09-13 21:58

import datetime
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),
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='Account',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='auth.user')),
                ('reviews_created', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Review',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('likes', models.IntegerField(default=0)),
                ('text', models.TextField(max_length=1000)),
                ('title', models.CharField(max_length=25)),
                ('create_date', models.DateTimeField(default=datetime.datetime.now)),
                ('slug', models.SlugField(max_length=25, unique=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='author', to='main.account')),
                ('fans', models.ManyToManyField(related_name='fans', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-likes'],
            },
        ),
        migrations.AddIndex(
            model_name='account',
            index=models.Index(fields=['user'], name='main_accoun_user_id_b67045_idx'),
        ),
        migrations.AddIndex(
            model_name='review',
            index=models.Index(fields=['slug'], name='main_review_slug_7d4051_idx'),
        ),
        migrations.AddIndex(
            model_name='review',
            index=models.Index(fields=['author_id'], name='main_review_author__697c3b_idx'),
        ),
    ]
