Add WIP
This commit is contained in:
@ -1,17 +1,45 @@
|
||||
# Generated by Django 5.0.6 on 2024-07-01 00:08
|
||||
# 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
|
||||
from django.db.migrations.operations.base import Operation
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
initial = True
|
||||
|
||||
dependencies: list[tuple[str, str]] = []
|
||||
dependencies = []
|
||||
|
||||
operations: list[Operation] = [
|
||||
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=[
|
||||
@ -28,10 +56,33 @@ class Migration(migrations.Migration):
|
||||
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",
|
||||
@ -41,97 +92,69 @@ class Migration(migrations.Migration):
|
||||
("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="DropBenefit",
|
||||
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)),
|
||||
("is_ios_available", models.BooleanField(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)),
|
||||
(
|
||||
"game",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="twitch_app.game",
|
||||
),
|
||||
),
|
||||
(
|
||||
"owner_organization",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="twitch_app.organization",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="TimeBasedDrop",
|
||||
fields=[
|
||||
("id", models.TextField(primary_key=True, serialize=False)),
|
||||
("required_subs", models.IntegerField(blank=True, null=True)),
|
||||
("end_at", models.DateTimeField(blank=True, null=True)),
|
||||
("name", models.TextField(blank=True, null=True)),
|
||||
(
|
||||
"required_minutes_watched",
|
||||
models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
("required_minutes_watched", models.IntegerField(blank=True, null=True)),
|
||||
("start_at", models.DateTimeField(blank=True, null=True)),
|
||||
("added_at", models.DateTimeField(auto_now_add=True, null=True)),
|
||||
("modified_at", models.DateTimeField(auto_now=True, null=True)),
|
||||
("benefits", models.ManyToManyField(to="twitch_app.dropbenefit")),
|
||||
],
|
||||
),
|
||||
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)),
|
||||
(
|
||||
"game",
|
||||
models.ForeignKey(
|
||||
"drop_campaign",
|
||||
auto_prefetch.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="drop_campaigns",
|
||||
to="twitch_app.game",
|
||||
related_name="drops",
|
||||
to="twitch_app.dropcampaign",
|
||||
),
|
||||
),
|
||||
(
|
||||
"owner",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="drop_campaigns",
|
||||
to="twitch_app.organization",
|
||||
),
|
||||
),
|
||||
(
|
||||
"time_based_drops",
|
||||
models.ManyToManyField(to="twitch_app.timebaseddrop"),
|
||||
),
|
||||
],
|
||||
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.CreateModel(
|
||||
name="User",
|
||||
fields=[
|
||||
("id", models.TextField(primary_key=True, serialize=False)),
|
||||
("added_at", models.DateTimeField(auto_now_add=True, null=True)),
|
||||
("modified_at", models.DateTimeField(auto_now=True, null=True)),
|
||||
(
|
||||
"drop_campaigns",
|
||||
models.ManyToManyField(to="twitch_app.dropcampaign"),
|
||||
),
|
||||
],
|
||||
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",
|
||||
),
|
||||
),
|
||||
]
|
||||
|
Reference in New Issue
Block a user