text: # Generated by Django 3.1.1 on 2020-10-02 12:37
  
  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),
      ]
  
      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=150, unique=True)),
                  ('slug', models.SlugField(blank=True)),
              ],
          ),
          migrations.CreateModel(
              name='Comment',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('text', models.TextField()),
                  ('created_at', models.DateTimeField(auto_now_add=True)),
                  ('updated_at', models.DateTimeField(auto_now=True)),
                  ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
              ],
          ),
          migrations.CreateModel(
              name='Favorite',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('fav_type', models.IntegerField(choices=[(1, 'LIKE'), (2, 'DISLIKE')])),
              ],
          ),
          migrations.CreateModel(
              name='Quiz',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('title', models.CharField(max_length=250)),
                  ('slug', models.SlugField(blank=True)),
                  ('description', models.TextField()),
                  ('created_at', models.DateTimeField(auto_now_add=True)),
                  ('updated_at', models.DateTimeField(auto_now=True)),
                  ('image', models.ImageField(blank=True, null=True, upload_to='quiz')),
                  ('author', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='quizes', to=settings.AUTH_USER_MODEL)),
                  ('categories', models.ManyToManyField(related_name='category_quizes', to='quiz.Category')),
                  ('comments', models.ManyToManyField(related_name='quiz_comments', through='quiz.Comment', to=settings.AUTH_USER_MODEL)),
                  ('favorites', models.ManyToManyField(related_name='favtorite_quizes', through='quiz.Favorite', to=settings.AUTH_USER_MODEL)),
              ],
          ),
          migrations.CreateModel(
              name='Question',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('text', models.TextField()),
                  ('quiz', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='questions', to='quiz.quiz')),
              ],
          ),
          migrations.CreateModel(
              name='Option',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('text', models.TextField()),
                  ('is_answer', models.BooleanField(default=False)),
                  ('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='options', to='quiz.question')),
              ],
          ),
          migrations.AddField(
              model_name='favorite',
              name='article',
              field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='quiz.quiz'),
          ),
          migrations.AddField(
              model_name='favorite',
              name='owner',
              field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='favorite_quizes', to=settings.AUTH_USER_MODEL),
          ),
          migrations.AddField(
              model_name='comment',
              name='quiz',
              field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='quiz.quiz'),
          ),
          migrations.AlterUniqueTogether(
              name='favorite',
              unique_together={('owner', 'article')},
          ),
      ]
  