180 lines
9.5 KiB
Python
180 lines
9.5 KiB
Python
# Generated by Django 5.2.19 on 2026-11-20 18:51
|
|
|
|
import catalog.models
|
|
import django.db.models.deletion
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('catalog', '0002_lock_slump_x_land_title'),
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.AddField(
|
|
model_name='chapter',
|
|
name='announce_countdown',
|
|
field=models.BooleanField(default=False, help_text='Show the cover, title, and countdown before release. Only scheduled chapters can be announced.'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='chapter',
|
|
name='reader_direction',
|
|
field=models.CharField(choices=[('rtl', 'Right to left'), ('ltr', 'Left to right')], default='rtl', max_length=3),
|
|
),
|
|
migrations.AddField(
|
|
model_name='entry',
|
|
name='allow_comments',
|
|
field=models.BooleanField(default=True),
|
|
),
|
|
migrations.AddField(
|
|
model_name='entry',
|
|
name='byline',
|
|
field=models.CharField(blank=True, max_length=100),
|
|
),
|
|
migrations.AddField(
|
|
model_name='entry',
|
|
name='category',
|
|
field=models.CharField(blank=True, help_text='For example: Creator Notes, Announcements, or Behind the Pages.', max_length=60),
|
|
),
|
|
migrations.AddField(
|
|
model_name='sitesettings',
|
|
name='blur_countdown',
|
|
field=models.BooleanField(default=False),
|
|
),
|
|
migrations.AddField(
|
|
model_name='sitesettings',
|
|
name='countdown_art',
|
|
field=models.ImageField(blank=True, help_text='Optional separate backdrop for the Coming Soon page.', upload_to=catalog.models.image_path, validators=[catalog.models.validate_image]),
|
|
),
|
|
migrations.AddField(
|
|
model_name='sitesettings',
|
|
name='show_chapter_countdowns',
|
|
field=models.BooleanField(default=True),
|
|
),
|
|
migrations.AddField(
|
|
model_name='sitesettings',
|
|
name='stream_provider',
|
|
field=models.CharField(blank=True, choices=[('youtube', 'YouTube'), ('twitch', 'Twitch')], max_length=7),
|
|
),
|
|
migrations.AddField(
|
|
model_name='sitesettings',
|
|
name='stream_public_id',
|
|
field=models.CharField(blank=True, help_text='YouTube video ID or Twitch channel name. Never enter your private OBS stream key.', max_length=25, verbose_name='Public video ID or channel name'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='sitesettings',
|
|
name='stream_starts_at',
|
|
field=models.DateTimeField(blank=True, null=True),
|
|
),
|
|
migrations.AddField(
|
|
model_name='sitesettings',
|
|
name='stream_status',
|
|
field=models.CharField(choices=[('offline', 'Offline'), ('upcoming', 'Upcoming'), ('live', 'Live'), ('replay', 'Replay')], default='offline', max_length=8),
|
|
),
|
|
migrations.AddField(
|
|
model_name='sitesettings',
|
|
name='stream_title',
|
|
field=models.CharField(blank=True, max_length=140),
|
|
),
|
|
migrations.CreateModel(
|
|
name='DiscussionComment',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('body', models.CharField(max_length=1800)),
|
|
('status', models.CharField(choices=[('pending', 'Pending'), ('approved', 'Approved'), ('hidden', 'Hidden')], db_index=True, default='pending', max_length=8)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
|
('chapter', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='catalog.chapter')),
|
|
('entry', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='catalog.entry')),
|
|
('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='replies', to='catalog.discussioncomment')),
|
|
],
|
|
options={
|
|
'ordering': ['created_at', 'pk'],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='FanNotice',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('kind', models.CharField(choices=[('reply', 'replied to your comment'), ('like', 'liked your comment')], max_length=8)),
|
|
('seen', models.BooleanField(default=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('actor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
|
('comment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='catalog.discussioncomment')),
|
|
('recipient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='slx_notices', to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
options={
|
|
'ordering': ['-created_at', '-pk'],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='FanReaction',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('value', models.SmallIntegerField(choices=[(1, 'Like'), (-1, 'Dislike')], default=1)),
|
|
('chapter', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='catalog.chapter')),
|
|
('comment', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='catalog.discussioncomment')),
|
|
('entry', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='catalog.entry')),
|
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='ReaderRating',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('score', models.PositiveSmallIntegerField(choices=[(1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5')])),
|
|
('chapter', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='catalog.chapter')),
|
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='ReaderShelf',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('saved', models.BooleanField(default=False)),
|
|
('finished', models.BooleanField(default=False)),
|
|
('chapter', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='catalog.chapter')),
|
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='discussioncomment',
|
|
constraint=models.CheckConstraint(condition=models.Q(models.Q(('chapter__isnull', False), ('entry__isnull', True)), models.Q(('chapter__isnull', True), ('entry__isnull', False)), _connector='OR'), name='slx_comment_one_target'),
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='fannotice',
|
|
constraint=models.UniqueConstraint(fields=('actor', 'comment', 'kind'), name='slx_single_notice'),
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='fanreaction',
|
|
constraint=models.CheckConstraint(condition=models.Q(models.Q(('chapter__isnull', False), ('comment__isnull', True), ('entry__isnull', True), ('value', 1)), models.Q(('chapter__isnull', True), ('comment__isnull', True), ('entry__isnull', False), ('value', 1)), models.Q(('chapter__isnull', True), ('comment__isnull', False), ('entry__isnull', True), ('value__in', [-1, 1])), _connector='OR'), name='slx_reaction_one_target'),
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='fanreaction',
|
|
constraint=models.UniqueConstraint(fields=('user', 'chapter'), name='slx_one_chapter_reaction'),
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='fanreaction',
|
|
constraint=models.UniqueConstraint(fields=('user', 'entry'), name='slx_one_entry_reaction'),
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='fanreaction',
|
|
constraint=models.UniqueConstraint(fields=('user', 'comment'), name='slx_one_comment_reaction'),
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='readerrating',
|
|
constraint=models.UniqueConstraint(fields=('user', 'chapter'), name='slx_one_rating'),
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='readerrating',
|
|
constraint=models.CheckConstraint(condition=models.Q(('score__gte', 1), ('score__lte', 5)), name='slx_rating_range'),
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='readershelf',
|
|
constraint=models.UniqueConstraint(fields=('user', 'chapter'), name='slx_one_shelf_record'),
|
|
),
|
|
]
|