Lower line-length to default and don't add from __future__ import annotations to everything

This commit is contained in:
Joakim Hellsén 2026-03-09 04:37:54 +01:00
commit 1118c03c1b
Signed by: Joakim Hellsén
SSH key fingerprint: SHA256:/9h/CsExpFp+PRhsfA0xznFx2CGfTT5R/kpuFfUgEQk
46 changed files with 2338 additions and 1085 deletions

View file

@ -1,5 +1,5 @@
# Generated by Django 6.0 on 2025-12-11 10:49
from __future__ import annotations
import django.db.models.deletion
from django.db import migrations
@ -17,8 +17,19 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name="Game",
fields=[
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
("twitch_id", models.TextField(unique=True, verbose_name="Twitch game ID")),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"twitch_id",
models.TextField(unique=True, verbose_name="Twitch game ID"),
),
(
"slug",
models.TextField(
@ -30,8 +41,23 @@ class Migration(migrations.Migration):
),
),
("name", models.TextField(blank=True, default="", verbose_name="Name")),
("display_name", models.TextField(blank=True, default="", verbose_name="Display name")),
("box_art", models.URLField(blank=True, default="", max_length=500, verbose_name="Box art URL")),
(
"display_name",
models.TextField(
blank=True,
default="",
verbose_name="Display name",
),
),
(
"box_art",
models.URLField(
blank=True,
default="",
max_length=500,
verbose_name="Box art URL",
),
),
(
"box_art_file",
models.FileField(
@ -43,21 +69,33 @@ class Migration(migrations.Migration):
),
(
"added_at",
models.DateTimeField(auto_now_add=True, help_text="Timestamp when this game record was created."),
models.DateTimeField(
auto_now_add=True,
help_text="Timestamp when this game record was created.",
),
),
(
"updated_at",
models.DateTimeField(auto_now=True, help_text="Timestamp when this game record was last updated."),
models.DateTimeField(
auto_now=True,
help_text="Timestamp when this game record was last updated.",
),
),
],
options={
"ordering": ["display_name"],
},
options={"ordering": ["display_name"]},
),
migrations.CreateModel(
name="Channel",
fields=[
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"twitch_id",
models.TextField(
@ -66,7 +104,13 @@ class Migration(migrations.Migration):
verbose_name="Channel ID",
),
),
("name", models.TextField(help_text="The lowercase username of the channel.", verbose_name="Username")),
(
"name",
models.TextField(
help_text="The lowercase username of the channel.",
verbose_name="Username",
),
),
(
"display_name",
models.TextField(
@ -92,23 +136,54 @@ class Migration(migrations.Migration):
options={
"ordering": ["display_name"],
"indexes": [
models.Index(fields=["display_name"], name="twitch_chan_display_2bf213_idx"),
models.Index(
fields=["display_name"],
name="twitch_chan_display_2bf213_idx",
),
models.Index(fields=["name"], name="twitch_chan_name_15d566_idx"),
models.Index(fields=["twitch_id"], name="twitch_chan_twitch__c8bbc6_idx"),
models.Index(fields=["added_at"], name="twitch_chan_added_a_5ce7b4_idx"),
models.Index(fields=["updated_at"], name="twitch_chan_updated_828594_idx"),
models.Index(
fields=["twitch_id"],
name="twitch_chan_twitch__c8bbc6_idx",
),
models.Index(
fields=["added_at"],
name="twitch_chan_added_a_5ce7b4_idx",
),
models.Index(
fields=["updated_at"],
name="twitch_chan_updated_828594_idx",
),
],
},
),
migrations.CreateModel(
name="DropBenefit",
fields=[
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"twitch_id",
models.TextField(editable=False, help_text="The Twitch ID for this benefit.", unique=True),
models.TextField(
editable=False,
help_text="The Twitch ID for this benefit.",
unique=True,
),
),
(
"name",
models.TextField(
blank=True,
default="N/A",
help_text="Name of the drop benefit.",
),
),
("name", models.TextField(blank=True, default="N/A", help_text="Name of the drop benefit.")),
(
"image_asset_url",
models.URLField(
@ -130,7 +205,7 @@ class Migration(migrations.Migration):
(
"created_at",
models.DateTimeField(
help_text="Timestamp when the benefit was created. This is from Twitch API and not auto-generated.", # noqa: E501
help_text="Timestamp when the benefit was created. This is from Twitch API and not auto-generated.",
null=True,
),
),
@ -143,7 +218,10 @@ class Migration(migrations.Migration):
),
(
"is_ios_available",
models.BooleanField(default=False, help_text="Whether the benefit is available on iOS."),
models.BooleanField(
default=False,
help_text="Whether the benefit is available on iOS.",
),
),
(
"distribution_type",
@ -172,20 +250,46 @@ class Migration(migrations.Migration):
options={
"ordering": ["-created_at"],
"indexes": [
models.Index(fields=["-created_at"], name="twitch_drop_created_5d2280_idx"),
models.Index(fields=["twitch_id"], name="twitch_drop_twitch__6eab58_idx"),
models.Index(
fields=["-created_at"],
name="twitch_drop_created_5d2280_idx",
),
models.Index(
fields=["twitch_id"],
name="twitch_drop_twitch__6eab58_idx",
),
models.Index(fields=["name"], name="twitch_drop_name_7125ff_idx"),
models.Index(fields=["distribution_type"], name="twitch_drop_distrib_08b224_idx"),
models.Index(fields=["is_ios_available"], name="twitch_drop_is_ios__5f3dcf_idx"),
models.Index(fields=["added_at"], name="twitch_drop_added_a_fba438_idx"),
models.Index(fields=["updated_at"], name="twitch_drop_updated_7aaae3_idx"),
models.Index(
fields=["distribution_type"],
name="twitch_drop_distrib_08b224_idx",
),
models.Index(
fields=["is_ios_available"],
name="twitch_drop_is_ios__5f3dcf_idx",
),
models.Index(
fields=["added_at"],
name="twitch_drop_added_a_fba438_idx",
),
models.Index(
fields=["updated_at"],
name="twitch_drop_updated_7aaae3_idx",
),
],
},
),
migrations.CreateModel(
name="DropBenefitEdge",
fields=[
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"entitlement_limit",
models.PositiveIntegerField(
@ -220,16 +324,39 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name="DropCampaign",
fields=[
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"twitch_id",
models.TextField(editable=False, help_text="The Twitch ID for this campaign.", unique=True),
models.TextField(
editable=False,
help_text="The Twitch ID for this campaign.",
unique=True,
),
),
("name", models.TextField(help_text="Name of the drop campaign.")),
("description", models.TextField(blank=True, help_text="Detailed description of the campaign.")),
(
"description",
models.TextField(
blank=True,
help_text="Detailed description of the campaign.",
),
),
(
"details_url",
models.URLField(blank=True, default="", help_text="URL with campaign details.", max_length=500),
models.URLField(
blank=True,
default="",
help_text="URL with campaign details.",
max_length=500,
),
),
(
"account_link_url",
@ -260,23 +387,40 @@ class Migration(migrations.Migration):
),
(
"start_at",
models.DateTimeField(blank=True, help_text="Datetime when the campaign starts.", null=True),
models.DateTimeField(
blank=True,
help_text="Datetime when the campaign starts.",
null=True,
),
),
(
"end_at",
models.DateTimeField(
blank=True,
help_text="Datetime when the campaign ends.",
null=True,
),
),
("end_at", models.DateTimeField(blank=True, help_text="Datetime when the campaign ends.", null=True)),
(
"is_account_connected",
models.BooleanField(default=False, help_text="Indicates if the user account is linked."),
models.BooleanField(
default=False,
help_text="Indicates if the user account is linked.",
),
),
(
"allow_is_enabled",
models.BooleanField(default=True, help_text="Whether the campaign allows participation."),
models.BooleanField(
default=True,
help_text="Whether the campaign allows participation.",
),
),
(
"operation_name",
models.TextField(
blank=True,
default="",
help_text="The GraphQL operation name used to fetch this campaign data (e.g., 'ViewerDropsDashboard').", # noqa: E501
help_text="The GraphQL operation name used to fetch this campaign data (e.g., 'ViewerDropsDashboard').",
),
),
(
@ -313,14 +457,20 @@ class Migration(migrations.Migration):
),
),
],
options={
"ordering": ["-start_at"],
},
options={"ordering": ["-start_at"]},
),
migrations.CreateModel(
name="Organization",
fields=[
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"twitch_id",
models.TextField(
@ -332,7 +482,11 @@ class Migration(migrations.Migration):
),
(
"name",
models.TextField(help_text="Display name of the organization.", unique=True, verbose_name="Name"),
models.TextField(
help_text="Display name of the organization.",
unique=True,
verbose_name="Name",
),
),
(
"added_at",
@ -355,9 +509,18 @@ class Migration(migrations.Migration):
"ordering": ["name"],
"indexes": [
models.Index(fields=["name"], name="twitch_orga_name_febe72_idx"),
models.Index(fields=["twitch_id"], name="twitch_orga_twitch__b89b29_idx"),
models.Index(fields=["added_at"], name="twitch_orga_added_a_8297ac_idx"),
models.Index(fields=["updated_at"], name="twitch_orga_updated_d7d431_idx"),
models.Index(
fields=["twitch_id"],
name="twitch_orga_twitch__b89b29_idx",
),
models.Index(
fields=["added_at"],
name="twitch_orga_added_a_8297ac_idx",
),
models.Index(
fields=["updated_at"],
name="twitch_orga_updated_d7d431_idx",
),
],
},
),
@ -377,10 +540,22 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name="TimeBasedDrop",
fields=[
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"twitch_id",
models.TextField(editable=False, help_text="The Twitch ID for this time-based drop.", unique=True),
models.TextField(
editable=False,
help_text="The Twitch ID for this time-based drop.",
unique=True,
),
),
("name", models.TextField(help_text="Name of the time-based drop.")),
(
@ -400,9 +575,20 @@ class Migration(migrations.Migration):
),
(
"start_at",
models.DateTimeField(blank=True, help_text="Datetime when this drop becomes available.", null=True),
models.DateTimeField(
blank=True,
help_text="Datetime when this drop becomes available.",
null=True,
),
),
(
"end_at",
models.DateTimeField(
blank=True,
help_text="Datetime when this drop expires.",
null=True,
),
),
("end_at", models.DateTimeField(blank=True, help_text="Datetime when this drop expires.", null=True)),
(
"added_at",
models.DateTimeField(
@ -436,9 +622,7 @@ class Migration(migrations.Migration):
),
),
],
options={
"ordering": ["start_at"],
},
options={"ordering": ["start_at"]},
),
migrations.AddField(
model_name="dropbenefitedge",
@ -452,7 +636,15 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name="TwitchGameData",
fields=[
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"twitch_id",
models.TextField(
@ -472,9 +664,24 @@ class Migration(migrations.Migration):
verbose_name="Box art URL",
),
),
("igdb_id", models.TextField(blank=True, default="", verbose_name="IGDB ID")),
("added_at", models.DateTimeField(auto_now_add=True, help_text="Record creation time.")),
("updated_at", models.DateTimeField(auto_now=True, help_text="Record last update time.")),
(
"igdb_id",
models.TextField(blank=True, default="", verbose_name="IGDB ID"),
),
(
"added_at",
models.DateTimeField(
auto_now_add=True,
help_text="Record creation time.",
),
),
(
"updated_at",
models.DateTimeField(
auto_now=True,
help_text="Record last update time.",
),
),
(
"game",
models.ForeignKey(
@ -488,13 +695,14 @@ class Migration(migrations.Migration):
),
),
],
options={
"ordering": ["name"],
},
options={"ordering": ["name"]},
),
migrations.AddIndex(
model_name="dropcampaign",
index=models.Index(fields=["-start_at"], name="twitch_drop_start_a_929f09_idx"),
index=models.Index(
fields=["-start_at"],
name="twitch_drop_start_a_929f09_idx",
),
),
migrations.AddIndex(
model_name="dropcampaign",
@ -506,7 +714,10 @@ class Migration(migrations.Migration):
),
migrations.AddIndex(
model_name="dropcampaign",
index=models.Index(fields=["twitch_id"], name="twitch_drop_twitch__b717a1_idx"),
index=models.Index(
fields=["twitch_id"],
name="twitch_drop_twitch__b717a1_idx",
),
),
migrations.AddIndex(
model_name="dropcampaign",
@ -514,47 +725,80 @@ class Migration(migrations.Migration):
),
migrations.AddIndex(
model_name="dropcampaign",
index=models.Index(fields=["description"], name="twitch_drop_descrip_5bc290_idx"),
index=models.Index(
fields=["description"],
name="twitch_drop_descrip_5bc290_idx",
),
),
migrations.AddIndex(
model_name="dropcampaign",
index=models.Index(fields=["is_account_connected"], name="twitch_drop_is_acco_7e9078_idx"),
index=models.Index(
fields=["is_account_connected"],
name="twitch_drop_is_acco_7e9078_idx",
),
),
migrations.AddIndex(
model_name="dropcampaign",
index=models.Index(fields=["allow_is_enabled"], name="twitch_drop_allow_i_b64555_idx"),
index=models.Index(
fields=["allow_is_enabled"],
name="twitch_drop_allow_i_b64555_idx",
),
),
migrations.AddIndex(
model_name="dropcampaign",
index=models.Index(fields=["operation_name"], name="twitch_drop_operati_8cfeb5_idx"),
index=models.Index(
fields=["operation_name"],
name="twitch_drop_operati_8cfeb5_idx",
),
),
migrations.AddIndex(
model_name="dropcampaign",
index=models.Index(fields=["added_at"], name="twitch_drop_added_a_babe28_idx"),
index=models.Index(
fields=["added_at"],
name="twitch_drop_added_a_babe28_idx",
),
),
migrations.AddIndex(
model_name="dropcampaign",
index=models.Index(fields=["updated_at"], name="twitch_drop_updated_0df991_idx"),
index=models.Index(
fields=["updated_at"],
name="twitch_drop_updated_0df991_idx",
),
),
migrations.AddIndex(
model_name="dropcampaign",
index=models.Index(fields=["game", "-start_at"], name="twitch_drop_game_id_5e9b01_idx"),
index=models.Index(
fields=["game", "-start_at"],
name="twitch_drop_game_id_5e9b01_idx",
),
),
migrations.AddIndex(
model_name="dropcampaign",
index=models.Index(fields=["start_at", "end_at"], name="twitch_drop_start_a_6e5fb6_idx"),
index=models.Index(
fields=["start_at", "end_at"],
name="twitch_drop_start_a_6e5fb6_idx",
),
),
migrations.AddIndex(
model_name="dropcampaign",
index=models.Index(fields=["start_at", "end_at", "game"], name="twitch_drop_start_a_b02d4c_idx"),
index=models.Index(
fields=["start_at", "end_at", "game"],
name="twitch_drop_start_a_b02d4c_idx",
),
),
migrations.AddIndex(
model_name="dropcampaign",
index=models.Index(fields=["end_at", "-start_at"], name="twitch_drop_end_at_81e51b_idx"),
index=models.Index(
fields=["end_at", "-start_at"],
name="twitch_drop_end_at_81e51b_idx",
),
),
migrations.AddIndex(
model_name="game",
index=models.Index(fields=["display_name"], name="twitch_game_display_a35ba3_idx"),
index=models.Index(
fields=["display_name"],
name="twitch_game_display_a35ba3_idx",
),
),
migrations.AddIndex(
model_name="game",
@ -566,7 +810,10 @@ class Migration(migrations.Migration):
),
migrations.AddIndex(
model_name="game",
index=models.Index(fields=["twitch_id"], name="twitch_game_twitch__887f78_idx"),
index=models.Index(
fields=["twitch_id"],
name="twitch_game_twitch__887f78_idx",
),
),
migrations.AddIndex(
model_name="game",
@ -574,19 +821,31 @@ class Migration(migrations.Migration):
),
migrations.AddIndex(
model_name="game",
index=models.Index(fields=["added_at"], name="twitch_game_added_a_9e7e19_idx"),
index=models.Index(
fields=["added_at"],
name="twitch_game_added_a_9e7e19_idx",
),
),
migrations.AddIndex(
model_name="game",
index=models.Index(fields=["updated_at"], name="twitch_game_updated_01df03_idx"),
index=models.Index(
fields=["updated_at"],
name="twitch_game_updated_01df03_idx",
),
),
migrations.AddIndex(
model_name="game",
index=models.Index(fields=["owner", "display_name"], name="twitch_game_owner_i_7f9043_idx"),
index=models.Index(
fields=["owner", "display_name"],
name="twitch_game_owner_i_7f9043_idx",
),
),
migrations.AddIndex(
model_name="timebaseddrop",
index=models.Index(fields=["start_at"], name="twitch_time_start_a_13de4a_idx"),
index=models.Index(
fields=["start_at"],
name="twitch_time_start_a_13de4a_idx",
),
),
migrations.AddIndex(
model_name="timebaseddrop",
@ -594,11 +853,17 @@ class Migration(migrations.Migration):
),
migrations.AddIndex(
model_name="timebaseddrop",
index=models.Index(fields=["campaign"], name="twitch_time_campaig_bbe349_idx"),
index=models.Index(
fields=["campaign"],
name="twitch_time_campaig_bbe349_idx",
),
),
migrations.AddIndex(
model_name="timebaseddrop",
index=models.Index(fields=["twitch_id"], name="twitch_time_twitch__31707a_idx"),
index=models.Index(
fields=["twitch_id"],
name="twitch_time_twitch__31707a_idx",
),
),
migrations.AddIndex(
model_name="timebaseddrop",
@ -606,31 +871,52 @@ class Migration(migrations.Migration):
),
migrations.AddIndex(
model_name="timebaseddrop",
index=models.Index(fields=["required_minutes_watched"], name="twitch_time_require_82c30c_idx"),
index=models.Index(
fields=["required_minutes_watched"],
name="twitch_time_require_82c30c_idx",
),
),
migrations.AddIndex(
model_name="timebaseddrop",
index=models.Index(fields=["required_subs"], name="twitch_time_require_959431_idx"),
index=models.Index(
fields=["required_subs"],
name="twitch_time_require_959431_idx",
),
),
migrations.AddIndex(
model_name="timebaseddrop",
index=models.Index(fields=["added_at"], name="twitch_time_added_a_a7de2e_idx"),
index=models.Index(
fields=["added_at"],
name="twitch_time_added_a_a7de2e_idx",
),
),
migrations.AddIndex(
model_name="timebaseddrop",
index=models.Index(fields=["updated_at"], name="twitch_time_updated_9e9d9e_idx"),
index=models.Index(
fields=["updated_at"],
name="twitch_time_updated_9e9d9e_idx",
),
),
migrations.AddIndex(
model_name="timebaseddrop",
index=models.Index(fields=["campaign", "start_at"], name="twitch_time_campaig_29ac87_idx"),
index=models.Index(
fields=["campaign", "start_at"],
name="twitch_time_campaig_29ac87_idx",
),
),
migrations.AddIndex(
model_name="timebaseddrop",
index=models.Index(fields=["campaign", "required_minutes_watched"], name="twitch_time_campaig_920ae4_idx"),
index=models.Index(
fields=["campaign", "required_minutes_watched"],
name="twitch_time_campaig_920ae4_idx",
),
),
migrations.AddIndex(
model_name="timebaseddrop",
index=models.Index(fields=["start_at", "end_at"], name="twitch_time_start_a_c481f1_idx"),
index=models.Index(
fields=["start_at", "end_at"],
name="twitch_time_start_a_c481f1_idx",
),
),
migrations.AddIndex(
model_name="dropbenefitedge",
@ -638,23 +924,38 @@ class Migration(migrations.Migration):
),
migrations.AddIndex(
model_name="dropbenefitedge",
index=models.Index(fields=["benefit"], name="twitch_drop_benefit_c92c87_idx"),
index=models.Index(
fields=["benefit"],
name="twitch_drop_benefit_c92c87_idx",
),
),
migrations.AddIndex(
model_name="dropbenefitedge",
index=models.Index(fields=["entitlement_limit"], name="twitch_drop_entitle_bee3a0_idx"),
index=models.Index(
fields=["entitlement_limit"],
name="twitch_drop_entitle_bee3a0_idx",
),
),
migrations.AddIndex(
model_name="dropbenefitedge",
index=models.Index(fields=["added_at"], name="twitch_drop_added_a_2100ba_idx"),
index=models.Index(
fields=["added_at"],
name="twitch_drop_added_a_2100ba_idx",
),
),
migrations.AddIndex(
model_name="dropbenefitedge",
index=models.Index(fields=["updated_at"], name="twitch_drop_updated_00e3f2_idx"),
index=models.Index(
fields=["updated_at"],
name="twitch_drop_updated_00e3f2_idx",
),
),
migrations.AddConstraint(
model_name="dropbenefitedge",
constraint=models.UniqueConstraint(fields=("drop", "benefit"), name="unique_drop_benefit"),
constraint=models.UniqueConstraint(
fields=("drop", "benefit"),
name="unique_drop_benefit",
),
),
migrations.AddIndex(
model_name="twitchgamedata",
@ -662,7 +963,10 @@ class Migration(migrations.Migration):
),
migrations.AddIndex(
model_name="twitchgamedata",
index=models.Index(fields=["twitch_id"], name="twitch_twit_twitch__2207e6_idx"),
index=models.Index(
fields=["twitch_id"],
name="twitch_twit_twitch__2207e6_idx",
),
),
migrations.AddIndex(
model_name="twitchgamedata",
@ -670,14 +974,23 @@ class Migration(migrations.Migration):
),
migrations.AddIndex(
model_name="twitchgamedata",
index=models.Index(fields=["igdb_id"], name="twitch_twit_igdb_id_161335_idx"),
index=models.Index(
fields=["igdb_id"],
name="twitch_twit_igdb_id_161335_idx",
),
),
migrations.AddIndex(
model_name="twitchgamedata",
index=models.Index(fields=["added_at"], name="twitch_twit_added_a_2f4f36_idx"),
index=models.Index(
fields=["added_at"],
name="twitch_twit_added_a_2f4f36_idx",
),
),
migrations.AddIndex(
model_name="twitchgamedata",
index=models.Index(fields=["updated_at"], name="twitch_twit_updated_ca8c4b_idx"),
index=models.Index(
fields=["updated_at"],
name="twitch_twit_updated_ca8c4b_idx",
),
),
]

View file

@ -1,5 +1,5 @@
# Generated by Django 6.0 on 2026-01-05 20:47
from __future__ import annotations
from django.db import migrations
from django.db import models
@ -8,14 +8,18 @@ from django.db import models
class Migration(migrations.Migration):
"""Alter box_art field to allow null values."""
dependencies = [
("twitch", "0001_initial"),
]
dependencies = [("twitch", "0001_initial")]
operations = [
migrations.AlterField(
model_name="game",
name="box_art",
field=models.URLField(blank=True, default="", max_length=500, null=True, verbose_name="Box art URL"),
field=models.URLField(
blank=True,
default="",
max_length=500,
null=True,
verbose_name="Box art URL",
),
),
]

View file

@ -1,5 +1,5 @@
# Generated by Django 6.0 on 2026-01-05 22:29
from __future__ import annotations
from django.db import migrations
@ -7,17 +7,12 @@ from django.db import migrations
class Migration(migrations.Migration):
"""Remove is_account_connected field and its index from DropCampaign."""
dependencies = [
("twitch", "0002_alter_game_box_art"),
]
dependencies = [("twitch", "0002_alter_game_box_art")]
operations = [
migrations.RemoveIndex(
model_name="dropcampaign",
name="twitch_drop_is_acco_7e9078_idx",
),
migrations.RemoveField(
model_name="dropcampaign",
name="is_account_connected",
),
migrations.RemoveField(model_name="dropcampaign", name="is_account_connected"),
]

View file

@ -1,5 +1,5 @@
# Generated by Django 6.0.1 on 2026-01-09 20:52
from __future__ import annotations
from django.db import migrations
from django.db import models
@ -35,8 +35,5 @@ class Migration(migrations.Migration):
verbose_name="Organizations",
),
),
migrations.RemoveField(
model_name="game",
name="owner",
),
migrations.RemoveField(model_name="game", name="owner"),
]

View file

@ -1,5 +1,5 @@
# Generated by Django 6.0.1 on 2026-01-13 20:31
from __future__ import annotations
import django.db.models.deletion
from django.db import migrations
@ -17,35 +17,71 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name="RewardCampaign",
fields=[
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"twitch_id",
models.TextField(editable=False, help_text="The Twitch ID for this reward campaign.", unique=True),
models.TextField(
editable=False,
help_text="The Twitch ID for this reward campaign.",
unique=True,
),
),
("name", models.TextField(help_text="Name of the reward campaign.")),
(
"brand",
models.TextField(blank=True, default="", help_text="Brand associated with the reward campaign."),
models.TextField(
blank=True,
default="",
help_text="Brand associated with the reward campaign.",
),
),
(
"starts_at",
models.DateTimeField(blank=True, help_text="Datetime when the reward campaign starts.", null=True),
models.DateTimeField(
blank=True,
help_text="Datetime when the reward campaign starts.",
null=True,
),
),
(
"ends_at",
models.DateTimeField(blank=True, help_text="Datetime when the reward campaign ends.", null=True),
models.DateTimeField(
blank=True,
help_text="Datetime when the reward campaign ends.",
null=True,
),
),
(
"status",
models.TextField(default="UNKNOWN", help_text="Status of the reward campaign.", max_length=50),
models.TextField(
default="UNKNOWN",
help_text="Status of the reward campaign.",
max_length=50,
),
),
(
"summary",
models.TextField(blank=True, default="", help_text="Summary description of the reward campaign."),
models.TextField(
blank=True,
default="",
help_text="Summary description of the reward campaign.",
),
),
(
"instructions",
models.TextField(blank=True, default="", help_text="Instructions for the reward campaign."),
models.TextField(
blank=True,
default="",
help_text="Instructions for the reward campaign.",
),
),
(
"external_url",
@ -58,7 +94,11 @@ class Migration(migrations.Migration):
),
(
"reward_value_url_param",
models.TextField(blank=True, default="", help_text="URL parameter for reward value."),
models.TextField(
blank=True,
default="",
help_text="URL parameter for reward value.",
),
),
(
"about_url",
@ -71,7 +111,10 @@ class Migration(migrations.Migration):
),
(
"is_sitewide",
models.BooleanField(default=False, help_text="Whether the reward campaign is sitewide."),
models.BooleanField(
default=False,
help_text="Whether the reward campaign is sitewide.",
),
),
(
"added_at",
@ -102,18 +145,48 @@ class Migration(migrations.Migration):
options={
"ordering": ["-starts_at"],
"indexes": [
models.Index(fields=["-starts_at"], name="twitch_rewa_starts__4df564_idx"),
models.Index(fields=["ends_at"], name="twitch_rewa_ends_at_354b15_idx"),
models.Index(fields=["twitch_id"], name="twitch_rewa_twitch__797967_idx"),
models.Index(
fields=["-starts_at"],
name="twitch_rewa_starts__4df564_idx",
),
models.Index(
fields=["ends_at"],
name="twitch_rewa_ends_at_354b15_idx",
),
models.Index(
fields=["twitch_id"],
name="twitch_rewa_twitch__797967_idx",
),
models.Index(fields=["name"], name="twitch_rewa_name_f1e3dd_idx"),
models.Index(fields=["brand"], name="twitch_rewa_brand_41c321_idx"),
models.Index(fields=["status"], name="twitch_rewa_status_a96d6b_idx"),
models.Index(fields=["is_sitewide"], name="twitch_rewa_is_site_7d2c9f_idx"),
models.Index(fields=["game"], name="twitch_rewa_game_id_678fbb_idx"),
models.Index(fields=["added_at"], name="twitch_rewa_added_a_ae3748_idx"),
models.Index(fields=["updated_at"], name="twitch_rewa_updated_fdf599_idx"),
models.Index(fields=["starts_at", "ends_at"], name="twitch_rewa_starts__dd909d_idx"),
models.Index(fields=["status", "-starts_at"], name="twitch_rewa_status_3641a4_idx"),
models.Index(
fields=["status"],
name="twitch_rewa_status_a96d6b_idx",
),
models.Index(
fields=["is_sitewide"],
name="twitch_rewa_is_site_7d2c9f_idx",
),
models.Index(
fields=["game"],
name="twitch_rewa_game_id_678fbb_idx",
),
models.Index(
fields=["added_at"],
name="twitch_rewa_added_a_ae3748_idx",
),
models.Index(
fields=["updated_at"],
name="twitch_rewa_updated_fdf599_idx",
),
models.Index(
fields=["starts_at", "ends_at"],
name="twitch_rewa_starts__dd909d_idx",
),
models.Index(
fields=["status", "-starts_at"],
name="twitch_rewa_status_3641a4_idx",
),
],
},
),

View file

@ -1,5 +1,5 @@
# Generated by Django 6.0.1 on 2026-01-15 21:57
from __future__ import annotations
import django.db.models.deletion
from django.db import migrations
@ -9,15 +9,21 @@ from django.db import models
class Migration(migrations.Migration):
"""Add ChatBadgeSet and ChatBadge models for Twitch chat badges."""
dependencies = [
("twitch", "0005_add_reward_campaign"),
]
dependencies = [("twitch", "0005_add_reward_campaign")]
operations = [
migrations.CreateModel(
name="ChatBadgeSet",
fields=[
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"set_id",
models.TextField(
@ -46,16 +52,33 @@ class Migration(migrations.Migration):
options={
"ordering": ["set_id"],
"indexes": [
models.Index(fields=["set_id"], name="twitch_chat_set_id_9319f2_idx"),
models.Index(fields=["added_at"], name="twitch_chat_added_a_b0023a_idx"),
models.Index(fields=["updated_at"], name="twitch_chat_updated_90afed_idx"),
models.Index(
fields=["set_id"],
name="twitch_chat_set_id_9319f2_idx",
),
models.Index(
fields=["added_at"],
name="twitch_chat_added_a_b0023a_idx",
),
models.Index(
fields=["updated_at"],
name="twitch_chat_updated_90afed_idx",
),
],
},
),
migrations.CreateModel(
name="ChatBadge",
fields=[
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"badge_id",
models.TextField(
@ -87,10 +110,19 @@ class Migration(migrations.Migration):
verbose_name="Image URL (72px)",
),
),
("title", models.TextField(help_text="The title of the badge (e.g., 'VIP').", verbose_name="Title")),
(
"title",
models.TextField(
help_text="The title of the badge (e.g., 'VIP').",
verbose_name="Title",
),
),
(
"description",
models.TextField(help_text="The description of the badge.", verbose_name="Description"),
models.TextField(
help_text="The description of the badge.",
verbose_name="Description",
),
),
(
"click_action",
@ -141,13 +173,30 @@ class Migration(migrations.Migration):
options={
"ordering": ["badge_set", "badge_id"],
"indexes": [
models.Index(fields=["badge_set"], name="twitch_chat_badge_s_54f225_idx"),
models.Index(fields=["badge_id"], name="twitch_chat_badge_i_58a68a_idx"),
models.Index(
fields=["badge_set"],
name="twitch_chat_badge_s_54f225_idx",
),
models.Index(
fields=["badge_id"],
name="twitch_chat_badge_i_58a68a_idx",
),
models.Index(fields=["title"], name="twitch_chat_title_0f42d2_idx"),
models.Index(fields=["added_at"], name="twitch_chat_added_a_9ba7dd_idx"),
models.Index(fields=["updated_at"], name="twitch_chat_updated_568ad1_idx"),
models.Index(
fields=["added_at"],
name="twitch_chat_added_a_9ba7dd_idx",
),
models.Index(
fields=["updated_at"],
name="twitch_chat_updated_568ad1_idx",
),
],
"constraints": [
models.UniqueConstraint(
fields=("badge_set", "badge_id"),
name="unique_badge_set_id",
),
],
"constraints": [models.UniqueConstraint(fields=("badge_set", "badge_id"), name="unique_badge_set_id")],
},
),
]

View file

@ -1,5 +1,5 @@
# Generated by Django 6.0.1 on 2026-01-17 05:32
from __future__ import annotations
from django.db import migrations
from django.db import models
@ -26,9 +26,7 @@ def reverse_operation_names_to_string(apps, schema_editor) -> None: # noqa: ARG
class Migration(migrations.Migration):
"""Rename operation_name field to operation_names and convert to list."""
dependencies = [
("twitch", "0006_add_chat_badges"),
]
dependencies = [("twitch", "0006_add_chat_badges")]
operations = [
migrations.RemoveIndex(
@ -41,7 +39,7 @@ class Migration(migrations.Migration):
field=models.JSONField(
blank=True,
default=list,
help_text="List of GraphQL operation names used to fetch this campaign data (e.g., ['ViewerDropsDashboard', 'Inventory']).", # noqa: E501
help_text="List of GraphQL operation names used to fetch this campaign data (e.g., ['ViewerDropsDashboard', 'Inventory']).",
),
),
migrations.RunPython(
@ -50,10 +48,10 @@ class Migration(migrations.Migration):
),
migrations.AddIndex(
model_name="dropcampaign",
index=models.Index(fields=["operation_names"], name="twitch_drop_operati_fe3bc8_idx"),
),
migrations.RemoveField(
model_name="dropcampaign",
name="operation_name",
index=models.Index(
fields=["operation_names"],
name="twitch_drop_operati_fe3bc8_idx",
),
),
migrations.RemoveField(model_name="dropcampaign", name="operation_name"),
]

View file

@ -1,25 +1,29 @@
# Generated by Django 6.0.2 on 2026-02-09 19:04
from __future__ import annotations
import django.db.models.manager
from django.db import migrations
class Migration(migrations.Migration):
"Alter model options to use prefetch_manager as the base manager and set default ordering for better performance and consistent query results." # noqa: E501
"Alter model options to use prefetch_manager as the base manager and set default ordering for better performance and consistent query results."
dependencies = [
("twitch", "0007_rename_operation_name_to_operation_names"),
]
dependencies = [("twitch", "0007_rename_operation_name_to_operation_names")]
operations = [
migrations.AlterModelOptions(
name="channel",
options={"base_manager_name": "prefetch_manager", "ordering": ["display_name"]},
options={
"base_manager_name": "prefetch_manager",
"ordering": ["display_name"],
},
),
migrations.AlterModelOptions(
name="chatbadge",
options={"base_manager_name": "prefetch_manager", "ordering": ["badge_set", "badge_id"]},
options={
"base_manager_name": "prefetch_manager",
"ordering": ["badge_set", "badge_id"],
},
),
migrations.AlterModelOptions(
name="chatbadgeset",
@ -27,7 +31,10 @@ class Migration(migrations.Migration):
),
migrations.AlterModelOptions(
name="dropbenefit",
options={"base_manager_name": "prefetch_manager", "ordering": ["-created_at"]},
options={
"base_manager_name": "prefetch_manager",
"ordering": ["-created_at"],
},
),
migrations.AlterModelOptions(
name="dropbenefitedge",
@ -35,11 +42,17 @@ class Migration(migrations.Migration):
),
migrations.AlterModelOptions(
name="dropcampaign",
options={"base_manager_name": "prefetch_manager", "ordering": ["-start_at"]},
options={
"base_manager_name": "prefetch_manager",
"ordering": ["-start_at"],
},
),
migrations.AlterModelOptions(
name="game",
options={"base_manager_name": "prefetch_manager", "ordering": ["display_name"]},
options={
"base_manager_name": "prefetch_manager",
"ordering": ["display_name"],
},
),
migrations.AlterModelOptions(
name="organization",
@ -47,7 +60,10 @@ class Migration(migrations.Migration):
),
migrations.AlterModelOptions(
name="rewardcampaign",
options={"base_manager_name": "prefetch_manager", "ordering": ["-starts_at"]},
options={
"base_manager_name": "prefetch_manager",
"ordering": ["-starts_at"],
},
),
migrations.AlterModelOptions(
name="timebaseddrop",

View file

@ -1,5 +1,5 @@
# Generated by Django 6.0.2 on 2026-02-09 19:05
from __future__ import annotations
import auto_prefetch
import django.db.models.deletion
@ -7,7 +7,7 @@ from django.db import migrations
class Migration(migrations.Migration):
"Alter ChatBadge.badge_set to use auto_prefetch.ForeignKey and update related fields to use auto_prefetch.ForeignKey as well for better performance." # noqa: E501
"Alter ChatBadge.badge_set to use auto_prefetch.ForeignKey and update related fields to use auto_prefetch.ForeignKey as well for better performance."
dependencies = [
("twitch", "0008_alter_channel_options_alter_chatbadge_options_and_more"),

View file

@ -1,16 +1,14 @@
# Generated by Django 6.0.2 on 2026-02-11 22:55
from __future__ import annotations
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
"""Add image_file and image_url fields to RewardCampaign model for storing local file and original URL of campaign images.""" # noqa: E501
"""Add image_file and image_url fields to RewardCampaign model for storing local file and original URL of campaign images."""
dependencies = [
("twitch", "0009_alter_chatbadge_badge_set_and_more"),
]
dependencies = [("twitch", "0009_alter_chatbadge_badge_set_and_more")]
operations = [
migrations.AddField(

View file

@ -1,12 +1,12 @@
# Generated by Django 6.0.2 on 2026-02-12 03:41
from __future__ import annotations
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
"""Add image height and width fields to DropBenefit, DropCampaign, Game, and RewardCampaign, then update ImageFields to use them.""" # noqa: E501
"""Add image height and width fields to DropBenefit, DropCampaign, Game, and RewardCampaign, then update ImageFields to use them."""
dependencies = [
("twitch", "0010_rewardcampaign_image_file_rewardcampaign_image_url"),

View file

@ -1,5 +1,5 @@
# Generated by Django 6.0.2 on 2026-02-12 12:00
from __future__ import annotations
from django.contrib.postgres.indexes import GinIndex
from django.db import migrations
@ -19,6 +19,9 @@ class Migration(migrations.Migration):
),
migrations.AddIndex(
model_name="dropcampaign",
index=GinIndex(fields=["operation_names"], name="twitch_drop_operati_gin_idx"),
index=GinIndex(
fields=["operation_names"],
name="twitch_drop_operati_gin_idx",
),
),
]