text: # Generated by Django 3.0.5 on 2021-02-01 19:20
  
  import django.core.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')),
                  ('name', models.CharField(max_length=50, unique=True, verbose_name='Категория')),
                  ('slug', models.SlugField(null=True, unique=True)),
              ],
          ),
          migrations.CreateModel(
              name='Comments',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('text', models.TextField(verbose_name='Текст комментария')),
                  ('pub_date', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='Дата добавления комментария')),
              ],
              options={
                  'ordering': ('-pub_date',),
              },
          ),
          migrations.CreateModel(
              name='Genre',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('name', models.CharField(max_length=50, unique=True, verbose_name='Жанр')),
                  ('slug', models.SlugField(null=True, unique=True)),
              ],
          ),
          migrations.CreateModel(
              name='Review',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('text', models.TextField(verbose_name='Текст')),
                  ('pub_date', models.DateTimeField(auto_now_add=True, verbose_name='Дата публикации')),
                  ('score', models.PositiveSmallIntegerField(validators=[django.core.validators.MaxValueValidator(10, 'Оценка не может превышать 10')], verbose_name='Оценка')),
              ],
              options={
                  'ordering': ('-pub_date',),
              },
          ),
          migrations.CreateModel(
              name='Title',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('name', models.CharField(max_length=100, verbose_name='Название произведения')),
                  ('year', models.PositiveIntegerField(default=2021, validators=[django.core.validators.MaxValueValidator(2021)])),
                  ('rating', models.PositiveSmallIntegerField(null=True, validators=[django.core.validators.MaxValueValidator(10, 'Рейтинг не может быть выше 10')], verbose_name='Рейтинг')),
                  ('description', models.TextField(max_length=1000, verbose_name='Краткое описание')),
                  ('slug', models.SlugField(max_length=40)),
                  ('category', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='titles', to='api.Category', verbose_name='Категория')),
                  ('genre', models.ManyToManyField(related_name='title', to='api.Genre')),
              ],
          ),
      ]
  