61 lines
3.4 KiB
Python
61 lines
3.4 KiB
Python
# Generated by Django 5.0.1 on 2024-02-07 23:19
|
|
|
|
import apps.home.models
|
|
import django.db.models.deletion
|
|
import django.utils.timezone
|
|
import uuid
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='DiscordChannel',
|
|
fields=[
|
|
('id', models.PositiveBigIntegerField(editable=False, help_text='Unique identifier of the channel, provided by Discord.', primary_key=True, serialize=False, verbose_name='id')),
|
|
('creation_datetime', models.DateTimeField(default=django.utils.timezone.now, editable=False, help_text='when this instance was created.', verbose_name='creation datetime')),
|
|
],
|
|
options={
|
|
'verbose_name': 'discord channel',
|
|
'verbose_name_plural': 'discord channels',
|
|
'get_latest_by': '-creation_datetime',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='Subscription',
|
|
fields=[
|
|
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('name', models.CharField(help_text='Reference name for this subscription (max %(max_length)s chars).', max_length=32, verbose_name='name')),
|
|
('rss_url', models.URLField(help_text='URL of the subscribed to RSS feed.', verbose_name='rss url')),
|
|
('image', models.ImageField(blank=True, default='../static/images/defaultuser.webp', help_text='image of the RSS feed.', null=True, storage=apps.home.models.OverwriteStorage(), upload_to=apps.home.models.Subscription_IconPathGenerator(), verbose_name='image')),
|
|
('creation_datetime', models.DateTimeField(default=django.utils.timezone.now, editable=False, help_text='when this instance was created.', verbose_name='creation datetime')),
|
|
('server', models.PositiveBigIntegerField(help_text='Identifier for the discord server that owns this subscription.', verbose_name='server id')),
|
|
('channels', models.ManyToManyField(help_text='List of Discord Channels acting as targets for subscription content.', to='home.discordchannel', verbose_name='channels')),
|
|
],
|
|
options={
|
|
'verbose_name': 'subscription',
|
|
'verbose_name_plural': 'subscriptions',
|
|
'get_latest_by': '-creation_datetime',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='TrackedContent',
|
|
fields=[
|
|
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('content_url', models.URLField(help_text='URL of the tracked content.', verbose_name='content url')),
|
|
('creation_datetime', models.DateTimeField(default=django.utils.timezone.now, editable=False, help_text='when this instance was created.', verbose_name='creation datetime')),
|
|
('subscription', models.ForeignKey(help_text='The subscription that this content originated from.', on_delete=django.db.models.deletion.CASCADE, related_name='tracked_content', to='home.subscription', verbose_name='subscription')),
|
|
],
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='subscription',
|
|
constraint=models.UniqueConstraint(fields=('name', 'server'), name='unique name & server pair'),
|
|
),
|
|
]
|