Save channels to the database

This commit is contained in:
Joakim Hellsén 2025-09-08 22:18:32 +02:00
commit 48783fadc2
5 changed files with 162 additions and 5 deletions

View file

@ -0,0 +1,37 @@
# Generated by Django 5.2.5 on 2025-09-08 17:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('twitch', '0012_dropbenefit_search_vector_game_search_vector_and_more'),
]
operations = [
migrations.AddField(
model_name='dropcampaign',
name='allow_is_enabled',
field=models.BooleanField(default=True, help_text='Whether the campaign allows participation.'),
),
migrations.CreateModel(
name='Channel',
fields=[
('id', models.CharField(help_text='The unique Twitch identifier for the channel.', max_length=255, primary_key=True, serialize=False, verbose_name='Channel ID')),
('name', models.CharField(db_index=True, help_text='The lowercase username of the channel.', max_length=255, verbose_name='Username')),
('display_name', models.CharField(db_index=True, help_text='The display name of the channel (with proper capitalization).', max_length=255, verbose_name='Display Name')),
('added_at', models.DateTimeField(auto_now_add=True, db_index=True, help_text='Timestamp when this channel record was created.')),
('updated_at', models.DateTimeField(auto_now=True, help_text='Timestamp when this channel record was last updated.')),
],
options={
'ordering': ['display_name'],
'indexes': [models.Index(fields=['name'], name='twitch_chan_name_15d566_idx'), models.Index(fields=['display_name'], name='twitch_chan_display_2bf213_idx')],
},
),
migrations.AddField(
model_name='dropcampaign',
name='allow_channels',
field=models.ManyToManyField(blank=True, help_text='Channels that are allowed to participate in this campaign.', related_name='allowed_campaigns', to='twitch.channel'),
),
]