55 lines
2.7 KiB
Python
55 lines
2.7 KiB
Python
# Generated by Django 5.0.1 on 2024-01-30 20:45
|
|
|
|
import apps.home.models
|
|
import django.utils.timezone
|
|
import uuid
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='FeedChannel',
|
|
fields=[
|
|
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('discord_server_id', models.PositiveBigIntegerField(help_text='the discord server id of this item', verbose_name='discord server id')),
|
|
('discord_channel_id', models.PositiveBigIntegerField(help_text='the discord channel id of this item', verbose_name='discord channel id')),
|
|
('created_at', models.DateTimeField(default=django.utils.timezone.now, editable=False, help_text='when this item was created', verbose_name='creation date & time')),
|
|
],
|
|
options={
|
|
'verbose_name': 'Feed Channel',
|
|
'verbose_name_plural': 'Feed Channels',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='RSSFeed',
|
|
fields=[
|
|
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('name', models.CharField(help_text='a human readable nickname for this item', max_length=120, verbose_name='name')),
|
|
('url', models.URLField(help_text='url to the RSS feed', verbose_name='url')),
|
|
('image', models.ImageField(blank=True, help_text='image of the RSS feed', null=True, storage=apps.home.models.OverwriteStorage(), upload_to=apps.home.models.RSSFeedIconPathGenerator(), verbose_name='image')),
|
|
('created_at', models.DateTimeField(default=django.utils.timezone.now, editable=False, help_text='when this item was created', verbose_name='creation date & time')),
|
|
('discord_server_id', models.PositiveBigIntegerField(help_text='the discord server id of this item', verbose_name='discord server id')),
|
|
],
|
|
options={
|
|
'verbose_name': 'RSS Feed',
|
|
'verbose_name_plural': 'RSS Feeds',
|
|
},
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='rssfeed',
|
|
constraint=models.UniqueConstraint(fields=('name', 'discord_server_id'), name='unique name & server pair'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='feedchannel',
|
|
name='feeds',
|
|
field=models.ManyToManyField(help_text='the feeds to include in this item', related_name='queues', to='home.rssfeed', verbose_name='feeds'),
|
|
),
|
|
]
|