161 lines
6.7 KiB
Python
161 lines
6.7 KiB
Python
# Generated by Django 5.1b1 on 2024-07-09 22:26
|
|
|
|
import auto_prefetch
|
|
import django.db.models.deletion
|
|
import django.db.models.functions.text
|
|
import django.db.models.manager
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
initial = True
|
|
|
|
dependencies = []
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="DropCampaign",
|
|
fields=[
|
|
("id", models.TextField(primary_key=True, serialize=False)),
|
|
("account_link_url", models.URLField(blank=True, null=True)),
|
|
("description", models.TextField(blank=True, null=True)),
|
|
("details_url", models.URLField(blank=True, null=True)),
|
|
("end_at", models.DateTimeField(blank=True, null=True)),
|
|
("image_url", models.URLField(blank=True, null=True)),
|
|
("name", models.TextField(blank=True, null=True)),
|
|
("start_at", models.DateTimeField(blank=True, null=True)),
|
|
("status", models.TextField(blank=True, null=True)),
|
|
("added_at", models.DateTimeField(auto_now_add=True, null=True)),
|
|
("modified_at", models.DateTimeField(auto_now=True, null=True)),
|
|
],
|
|
options={
|
|
"verbose_name": "Drop Campaign",
|
|
"verbose_name_plural": "Drop Campaigns",
|
|
"ordering": ("name",),
|
|
"abstract": False,
|
|
"base_manager_name": "prefetch_manager",
|
|
},
|
|
managers=[
|
|
("objects", django.db.models.manager.Manager()),
|
|
("prefetch_manager", django.db.models.manager.Manager()),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name="Game",
|
|
fields=[
|
|
("id", models.TextField(primary_key=True, serialize=False)),
|
|
("slug", models.TextField(blank=True, null=True)),
|
|
(
|
|
"twitch_url",
|
|
models.GeneratedField( # type: ignore # noqa: PGH003
|
|
db_persist=True,
|
|
expression=django.db.models.functions.text.Concat(
|
|
models.Value("https://www.twitch.tv/directory/category/"),
|
|
"slug",
|
|
),
|
|
output_field=models.TextField(),
|
|
),
|
|
),
|
|
(
|
|
"image_url",
|
|
models.GeneratedField( # type: ignore # noqa: PGH003
|
|
db_persist=True,
|
|
expression=django.db.models.functions.text.Concat(
|
|
models.Value("https://static-cdn.jtvnw.net/ttv-boxart/"),
|
|
"id",
|
|
models.Value("_IGDB.jpg"),
|
|
),
|
|
output_field=models.URLField(),
|
|
),
|
|
),
|
|
("display_name", models.TextField(blank=True, null=True)),
|
|
("added_at", models.DateTimeField(auto_now_add=True, null=True)),
|
|
("modified_at", models.DateTimeField(auto_now=True, null=True)),
|
|
],
|
|
options={
|
|
"verbose_name": "Game",
|
|
"verbose_name_plural": "Games",
|
|
"ordering": ("display_name",),
|
|
"abstract": False,
|
|
"base_manager_name": "prefetch_manager",
|
|
},
|
|
managers=[
|
|
("objects", django.db.models.manager.Manager()),
|
|
("prefetch_manager", django.db.models.manager.Manager()),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name="Organization",
|
|
fields=[
|
|
("id", models.TextField(primary_key=True, serialize=False)),
|
|
("name", models.TextField(blank=True, null=True)),
|
|
("added_at", models.DateTimeField(auto_now_add=True, null=True)),
|
|
("modified_at", models.DateTimeField(auto_now=True, null=True)),
|
|
],
|
|
options={
|
|
"verbose_name": "Organization",
|
|
"verbose_name_plural": "Organizations",
|
|
"ordering": ("name",),
|
|
"abstract": False,
|
|
"base_manager_name": "prefetch_manager",
|
|
},
|
|
managers=[
|
|
("objects", django.db.models.manager.Manager()),
|
|
("prefetch_manager", django.db.models.manager.Manager()),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name="Drop",
|
|
fields=[
|
|
("id", models.TextField(primary_key=True, serialize=False)),
|
|
("created_at", models.DateTimeField(blank=True, null=True)),
|
|
("entitlement_limit", models.IntegerField(blank=True, null=True)),
|
|
("image_asset_url", models.URLField(blank=True, null=True)),
|
|
("name", models.TextField(blank=True, null=True)),
|
|
("added_at", models.DateTimeField(auto_now_add=True, null=True)),
|
|
("modified_at", models.DateTimeField(auto_now=True, null=True)),
|
|
("required_subs", models.IntegerField(blank=True, null=True)),
|
|
("end_at", models.DateTimeField(blank=True, null=True)),
|
|
("required_minutes_watched", models.IntegerField(blank=True, null=True)),
|
|
("start_at", models.DateTimeField(blank=True, null=True)),
|
|
(
|
|
"drop_campaign",
|
|
auto_prefetch.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="drops",
|
|
to="twitch_app.dropcampaign",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Drop",
|
|
"verbose_name_plural": "Drops",
|
|
"ordering": ("name",),
|
|
"abstract": False,
|
|
"base_manager_name": "prefetch_manager",
|
|
},
|
|
managers=[
|
|
("objects", django.db.models.manager.Manager()),
|
|
("prefetch_manager", django.db.models.manager.Manager()),
|
|
],
|
|
),
|
|
migrations.AddField(
|
|
model_name="dropcampaign",
|
|
name="game",
|
|
field=auto_prefetch.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="drop_campaigns",
|
|
to="twitch_app.game",
|
|
),
|
|
),
|
|
migrations.AddField(
|
|
model_name="game",
|
|
name="organization",
|
|
field=auto_prefetch.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="games",
|
|
to="twitch_app.organization",
|
|
),
|
|
),
|
|
]
|