# Generated by Django 5.2.19 on 2026-11-20 18:58 import django.db.models.deletion from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('catalog', '0004_title_follow_and_creator_note'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='ChapterReview', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('headline', models.CharField(max_length=120)), ('body', models.TextField(max_length=3000)), ('score', models.PositiveSmallIntegerField(choices=[(1, '1 / 5'), (2, '2 / 5'), (3, '3 / 5'), (4, '4 / 5'), (5, '5 / 5')])), ('contains_spoilers', models.BooleanField(default=False)), ('status', models.CharField(choices=[('pending', 'Pending'), ('approved', 'Approved'), ('hidden', 'Hidden')], default='pending', max_length=8)), ('updated_at', models.DateTimeField(auto_now=True)), ], options={ 'ordering': ['-updated_at', '-pk'], }, ), migrations.RemoveConstraint( model_name='fanreaction', name='slx_reaction_one_target', ), migrations.AddField( model_name='fanreaction', name='chapter_cover', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='cover_reactions', to='catalog.chapter'), ), migrations.AddField( model_name='fanreaction', name='entry_cover', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='cover_reactions', to='catalog.entry'), ), migrations.AddField( model_name='fanreaction', name='page', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='catalog.page'), ), migrations.AddField( model_name='readershelf', name='favorite', field=models.BooleanField(default=False), ), migrations.AlterField( model_name='fanreaction', name='value', field=models.SmallIntegerField(choices=[(1, 'Like'), (2, 'Love'), (-1, 'Dislike'), (3, 'Wow'), (4, 'Sad'), (5, 'Laugh')], default=1), ), migrations.AddConstraint( model_name='fanreaction', constraint=models.CheckConstraint(condition=models.Q(models.Q(models.Q(('chapter__isnull', False), ('chapter_cover__isnull', True), ('comment__isnull', True), ('entry__isnull', True), ('entry_cover__isnull', True), ('page__isnull', True)), models.Q(('chapter__isnull', True), ('chapter_cover__isnull', True), ('comment__isnull', True), ('entry__isnull', False), ('entry_cover__isnull', True), ('page__isnull', True)), models.Q(('chapter__isnull', True), ('chapter_cover__isnull', True), ('comment__isnull', False), ('entry__isnull', True), ('entry_cover__isnull', True), ('page__isnull', True)), models.Q(('chapter__isnull', True), ('chapter_cover__isnull', True), ('comment__isnull', True), ('entry__isnull', True), ('entry_cover__isnull', True), ('page__isnull', False)), models.Q(('chapter__isnull', True), ('chapter_cover__isnull', True), ('comment__isnull', True), ('entry__isnull', True), ('entry_cover__isnull', False), ('page__isnull', True)), models.Q(('chapter__isnull', True), ('chapter_cover__isnull', False), ('comment__isnull', True), ('entry__isnull', True), ('entry_cover__isnull', True), ('page__isnull', True)), _connector='OR'), ('value__in', [-1, 1, 2, 3, 4, 5])), name='slx_reaction_one_target'), ), migrations.AddConstraint( model_name='fanreaction', constraint=models.UniqueConstraint(fields=('user', 'page'), name='slx_one_page_reaction'), ), migrations.AddConstraint( model_name='fanreaction', constraint=models.UniqueConstraint(fields=('user', 'entry_cover'), name='slx_one_entry_cover_reaction'), ), migrations.AddConstraint( model_name='fanreaction', constraint=models.UniqueConstraint(fields=('user', 'chapter_cover'), name='slx_one_chapter_cover_reaction'), ), migrations.AddField( model_name='chapterreview', name='author', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='chapter_reviews', to=settings.AUTH_USER_MODEL), ), migrations.AddField( model_name='chapterreview', name='chapter', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reviews', to='catalog.chapter'), ), migrations.AddConstraint( model_name='chapterreview', constraint=models.UniqueConstraint(fields=('author', 'chapter'), name='slx_one_chapter_review'), ), migrations.AddConstraint( model_name='chapterreview', constraint=models.CheckConstraint(condition=models.Q(('score__gte', 1), ('score__lte', 5)), name='slx_review_score_range'), ), ]