768 lines
28 KiB
Python
768 lines
28 KiB
Python
# Generated by Django 5.0 on 2023-12-24 17:53
|
|
|
|
import django.db.models.deletion
|
|
import simple_history.models
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
initial = True
|
|
|
|
dependencies = [
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="Game",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
(
|
|
"game_id",
|
|
models.TextField(
|
|
help_text="The ID of the game.",
|
|
verbose_name="Game ID",
|
|
),
|
|
),
|
|
(
|
|
"display_name",
|
|
models.TextField(
|
|
help_text="The display name of the game.",
|
|
verbose_name="Game Name",
|
|
),
|
|
),
|
|
(
|
|
"slug",
|
|
models.TextField(
|
|
help_text="The slug of the game.",
|
|
verbose_name="Game Slug",
|
|
),
|
|
),
|
|
("image", models.ImageField(blank=True, upload_to="images/")),
|
|
("model_created", models.DateTimeField(auto_now_add=True)),
|
|
("model_updated", models.DateTimeField(auto_now=True)),
|
|
],
|
|
options={
|
|
"verbose_name": "Game",
|
|
"db_table": "game",
|
|
"db_table_comment": "A game.",
|
|
"ordering": ["display_name"],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="Owner",
|
|
fields=[
|
|
(
|
|
"owner_id",
|
|
models.UUIDField(
|
|
editable=False,
|
|
help_text="The ID of the owner.",
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="Owner ID",
|
|
),
|
|
),
|
|
(
|
|
"name",
|
|
models.TextField(
|
|
help_text="The name of the owner.",
|
|
verbose_name="Developer Name",
|
|
),
|
|
),
|
|
("image", models.ImageField(blank=True, upload_to="images/")),
|
|
("model_created", models.DateTimeField(auto_now_add=True)),
|
|
("model_updated", models.DateTimeField(auto_now=True)),
|
|
],
|
|
options={
|
|
"verbose_name": "Owner",
|
|
"db_table": "owner",
|
|
"db_table_comment": "An owner.",
|
|
"ordering": ["name"],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="Reward",
|
|
fields=[
|
|
(
|
|
"reward_id",
|
|
models.UUIDField(
|
|
editable=False,
|
|
help_text="The ID of the reward.",
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="Reward ID",
|
|
),
|
|
),
|
|
(
|
|
"name",
|
|
models.TextField(
|
|
help_text="The name of the reward.",
|
|
verbose_name="Reward Name",
|
|
),
|
|
),
|
|
(
|
|
"required_minutes_watched",
|
|
models.IntegerField(
|
|
help_text="The required minutes watched to earn the reward.",
|
|
verbose_name="Required Minutes Watched",
|
|
),
|
|
),
|
|
(
|
|
"is_available_on_ios",
|
|
models.BooleanField(
|
|
default=False,
|
|
help_text="If the reward is available on iOS.",
|
|
verbose_name="Available on iOS",
|
|
),
|
|
),
|
|
("image", models.ImageField(blank=True, upload_to="images/")),
|
|
(
|
|
"start_at",
|
|
models.DateTimeField(
|
|
help_text="The date and time the reward starts.",
|
|
verbose_name="Start At",
|
|
),
|
|
),
|
|
(
|
|
"end_at",
|
|
models.DateTimeField(
|
|
help_text="The date and time the reward ends.",
|
|
verbose_name="End At",
|
|
),
|
|
),
|
|
(
|
|
"created",
|
|
models.DateTimeField(
|
|
help_text="The date and time the reward was model_created. From Twitch JSON.",
|
|
),
|
|
),
|
|
(
|
|
"model_created",
|
|
models.DateTimeField(
|
|
auto_now_add=True,
|
|
help_text="The date and time the reward was model_created in the database.",
|
|
),
|
|
),
|
|
("model_model_updated", models.DateTimeField(auto_now=True)),
|
|
],
|
|
options={
|
|
"verbose_name": "Reward",
|
|
"db_table": "reward",
|
|
"db_table_comment": "A reward.",
|
|
"ordering": ["name"],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="TwitchChannel",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
(
|
|
"name",
|
|
models.TextField(
|
|
help_text="The name of the Twitch channel.",
|
|
verbose_name="Twitch Channel Name",
|
|
),
|
|
),
|
|
("image", models.ImageField(blank=True, upload_to="images/")),
|
|
("is_live", models.BooleanField(default=False)),
|
|
("model_created", models.DateTimeField(auto_now_add=True)),
|
|
("model_updated", models.DateTimeField(auto_now=True)),
|
|
],
|
|
options={
|
|
"verbose_name": "Twitch Channel",
|
|
"db_table": "twitch_channel",
|
|
"db_table_comment": "A Twitch channel.",
|
|
"ordering": ["name"],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="HistoricalGame",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigIntegerField(
|
|
auto_created=True,
|
|
blank=True,
|
|
db_index=True,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
(
|
|
"game_id",
|
|
models.TextField(
|
|
help_text="The ID of the game.",
|
|
verbose_name="Game ID",
|
|
),
|
|
),
|
|
(
|
|
"display_name",
|
|
models.TextField(
|
|
help_text="The display name of the game.",
|
|
verbose_name="Game Name",
|
|
),
|
|
),
|
|
(
|
|
"slug",
|
|
models.TextField(
|
|
help_text="The slug of the game.",
|
|
verbose_name="Game Slug",
|
|
),
|
|
),
|
|
("image", models.TextField(blank=True, max_length=100)),
|
|
("history_id", models.AutoField(primary_key=True, serialize=False)),
|
|
("history_date", models.DateTimeField(db_index=True)),
|
|
("history_change_reason", models.CharField(max_length=100, null=True)),
|
|
(
|
|
"history_type",
|
|
models.CharField(
|
|
choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
|
|
max_length=1,
|
|
),
|
|
),
|
|
(
|
|
"history_user",
|
|
models.ForeignKey(
|
|
null=True,
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
related_name="+",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "historical Game",
|
|
"verbose_name_plural": "historical Games",
|
|
"db_table": "game_history",
|
|
"ordering": ("-history_date", "-history_id"),
|
|
"get_latest_by": ("history_date", "history_id"),
|
|
},
|
|
bases=(simple_history.models.HistoricalChanges, models.Model),
|
|
),
|
|
migrations.CreateModel(
|
|
name="HistoricalOwner",
|
|
fields=[
|
|
(
|
|
"owner_id",
|
|
models.UUIDField(
|
|
db_index=True,
|
|
editable=False,
|
|
help_text="The ID of the owner.",
|
|
verbose_name="Owner ID",
|
|
),
|
|
),
|
|
(
|
|
"name",
|
|
models.TextField(
|
|
help_text="The name of the owner.",
|
|
verbose_name="Developer Name",
|
|
),
|
|
),
|
|
("image", models.TextField(blank=True, max_length=100)),
|
|
("history_id", models.AutoField(primary_key=True, serialize=False)),
|
|
("history_date", models.DateTimeField(db_index=True)),
|
|
("history_change_reason", models.CharField(max_length=100, null=True)),
|
|
(
|
|
"history_type",
|
|
models.CharField(
|
|
choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
|
|
max_length=1,
|
|
),
|
|
),
|
|
(
|
|
"history_user",
|
|
models.ForeignKey(
|
|
null=True,
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
related_name="+",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "historical Owner",
|
|
"verbose_name_plural": "historical Owners",
|
|
"db_table": "owner_history",
|
|
"ordering": ("-history_date", "-history_id"),
|
|
"get_latest_by": ("history_date", "history_id"),
|
|
},
|
|
bases=(simple_history.models.HistoricalChanges, models.Model),
|
|
),
|
|
migrations.CreateModel(
|
|
name="HistoricalReward",
|
|
fields=[
|
|
(
|
|
"reward_id",
|
|
models.UUIDField(
|
|
db_index=True,
|
|
editable=False,
|
|
help_text="The ID of the reward.",
|
|
verbose_name="Reward ID",
|
|
),
|
|
),
|
|
(
|
|
"name",
|
|
models.TextField(
|
|
help_text="The name of the reward.",
|
|
verbose_name="Reward Name",
|
|
),
|
|
),
|
|
(
|
|
"required_minutes_watched",
|
|
models.IntegerField(
|
|
help_text="The required minutes watched to earn the reward.",
|
|
verbose_name="Required Minutes Watched",
|
|
),
|
|
),
|
|
(
|
|
"is_available_on_ios",
|
|
models.BooleanField(
|
|
default=False,
|
|
help_text="If the reward is available on iOS.",
|
|
verbose_name="Available on iOS",
|
|
),
|
|
),
|
|
("image", models.TextField(blank=True, max_length=100)),
|
|
(
|
|
"start_at",
|
|
models.DateTimeField(
|
|
help_text="The date and time the reward starts.",
|
|
verbose_name="Start At",
|
|
),
|
|
),
|
|
(
|
|
"end_at",
|
|
models.DateTimeField(
|
|
help_text="The date and time the reward ends.",
|
|
verbose_name="End At",
|
|
),
|
|
),
|
|
(
|
|
"created",
|
|
models.DateTimeField(
|
|
help_text="The date and time the reward was model_created. From Twitch JSON.",
|
|
),
|
|
),
|
|
(
|
|
"model_created",
|
|
models.DateTimeField(
|
|
blank=True,
|
|
editable=False,
|
|
help_text="The date and time the reward was model_created in the database.",
|
|
),
|
|
),
|
|
(
|
|
"model_model_updated",
|
|
models.DateTimeField(blank=True, editable=False),
|
|
),
|
|
("history_id", models.AutoField(primary_key=True, serialize=False)),
|
|
("history_date", models.DateTimeField(db_index=True)),
|
|
("history_change_reason", models.CharField(max_length=100, null=True)),
|
|
(
|
|
"history_type",
|
|
models.CharField(
|
|
choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
|
|
max_length=1,
|
|
),
|
|
),
|
|
(
|
|
"history_user",
|
|
models.ForeignKey(
|
|
null=True,
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
related_name="+",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "historical Reward",
|
|
"verbose_name_plural": "historical Rewards",
|
|
"db_table": "reward_history",
|
|
"ordering": ("-history_date", "-history_id"),
|
|
"get_latest_by": ("history_date", "history_id"),
|
|
},
|
|
bases=(simple_history.models.HistoricalChanges, models.Model),
|
|
),
|
|
migrations.CreateModel(
|
|
name="HistoricalTwitchChannel",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigIntegerField(
|
|
auto_created=True,
|
|
blank=True,
|
|
db_index=True,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
(
|
|
"name",
|
|
models.TextField(
|
|
help_text="The name of the Twitch channel.",
|
|
verbose_name="Twitch Channel Name",
|
|
),
|
|
),
|
|
("image", models.TextField(blank=True, max_length=100)),
|
|
("is_live", models.BooleanField(default=False)),
|
|
("history_id", models.AutoField(primary_key=True, serialize=False)),
|
|
("history_date", models.DateTimeField(db_index=True)),
|
|
("history_change_reason", models.CharField(max_length=100, null=True)),
|
|
(
|
|
"history_type",
|
|
models.CharField(
|
|
choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
|
|
max_length=1,
|
|
),
|
|
),
|
|
(
|
|
"history_user",
|
|
models.ForeignKey(
|
|
null=True,
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
related_name="+",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "historical Twitch Channel",
|
|
"verbose_name_plural": "historical Twitch Channels",
|
|
"db_table": "twitch_channel_history",
|
|
"ordering": ("-history_date", "-history_id"),
|
|
"get_latest_by": ("history_date", "history_id"),
|
|
},
|
|
bases=(simple_history.models.HistoricalChanges, models.Model),
|
|
),
|
|
migrations.CreateModel(
|
|
name="HistoricalTwitchDrop",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigIntegerField(
|
|
auto_created=True,
|
|
blank=True,
|
|
db_index=True,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
(
|
|
"drop_id",
|
|
models.TextField(
|
|
help_text="The ID of the drop.",
|
|
verbose_name="Drop ID",
|
|
),
|
|
),
|
|
(
|
|
"name",
|
|
models.TextField(
|
|
help_text="The name of the drop.",
|
|
verbose_name="Drop Name",
|
|
),
|
|
),
|
|
(
|
|
"description",
|
|
models.TextField(
|
|
help_text="The description of the drop.",
|
|
verbose_name="Description",
|
|
),
|
|
),
|
|
(
|
|
"details_url",
|
|
models.URLField(
|
|
help_text="The URL to the drop details.",
|
|
verbose_name="Details URL",
|
|
),
|
|
),
|
|
(
|
|
"how_to_earn",
|
|
models.TextField(
|
|
help_text="How to earn the drop.",
|
|
verbose_name="How to Earn",
|
|
),
|
|
),
|
|
("image", models.TextField(blank=True, max_length=100)),
|
|
(
|
|
"start_date",
|
|
models.DateTimeField(
|
|
help_text="The date and time the drop starts.",
|
|
verbose_name="Start Date",
|
|
),
|
|
),
|
|
(
|
|
"end_date",
|
|
models.DateTimeField(
|
|
help_text="The date and time the drop ends.",
|
|
verbose_name="End Date",
|
|
),
|
|
),
|
|
(
|
|
"is_event_based",
|
|
models.BooleanField(
|
|
default=False,
|
|
help_text="If the drop is event based.",
|
|
verbose_name="Event Based",
|
|
),
|
|
),
|
|
(
|
|
"is_time_based",
|
|
models.BooleanField(
|
|
default=False,
|
|
help_text="If the drop is time based.",
|
|
verbose_name="Time Based",
|
|
),
|
|
),
|
|
(
|
|
"account_link_url",
|
|
models.URLField(
|
|
help_text="The URL to link the Twitch account.",
|
|
verbose_name="Connection",
|
|
),
|
|
),
|
|
(
|
|
"participating_channels",
|
|
models.URLField(
|
|
help_text="The URL to the Twitch stream.",
|
|
verbose_name="Participating Channels",
|
|
),
|
|
),
|
|
(
|
|
"status",
|
|
models.BooleanField(
|
|
default=False,
|
|
help_text="If the drop is active.",
|
|
verbose_name="Status",
|
|
),
|
|
),
|
|
("history_id", models.AutoField(primary_key=True, serialize=False)),
|
|
("history_date", models.DateTimeField(db_index=True)),
|
|
("history_change_reason", models.CharField(max_length=100, null=True)),
|
|
(
|
|
"history_type",
|
|
models.CharField(
|
|
choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
|
|
max_length=1,
|
|
),
|
|
),
|
|
(
|
|
"game",
|
|
models.ForeignKey(
|
|
blank=True,
|
|
db_constraint=False,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
to="twitch_drop_notifier.game",
|
|
verbose_name="Game",
|
|
),
|
|
),
|
|
(
|
|
"history_user",
|
|
models.ForeignKey(
|
|
null=True,
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
related_name="+",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
(
|
|
"developer",
|
|
models.ForeignKey(
|
|
blank=True,
|
|
db_constraint=False,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
to="twitch_drop_notifier.owner",
|
|
verbose_name="Developer",
|
|
),
|
|
),
|
|
(
|
|
"reward",
|
|
models.ForeignKey(
|
|
blank=True,
|
|
db_constraint=False,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
to="twitch_drop_notifier.reward",
|
|
verbose_name="Reward",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "historical Twitch Drop",
|
|
"verbose_name_plural": "historical Twitch Drops",
|
|
"db_table": "twitch_drop_history",
|
|
"ordering": ("-history_date", "-history_id"),
|
|
"get_latest_by": ("history_date", "history_id"),
|
|
},
|
|
bases=(simple_history.models.HistoricalChanges, models.Model),
|
|
),
|
|
migrations.CreateModel(
|
|
name="TwitchDrop",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
(
|
|
"drop_id",
|
|
models.TextField(
|
|
help_text="The ID of the drop.",
|
|
verbose_name="Drop ID",
|
|
),
|
|
),
|
|
(
|
|
"name",
|
|
models.TextField(
|
|
help_text="The name of the drop.",
|
|
verbose_name="Drop Name",
|
|
),
|
|
),
|
|
(
|
|
"description",
|
|
models.TextField(
|
|
help_text="The description of the drop.",
|
|
verbose_name="Description",
|
|
),
|
|
),
|
|
(
|
|
"details_url",
|
|
models.URLField(
|
|
help_text="The URL to the drop details.",
|
|
verbose_name="Details URL",
|
|
),
|
|
),
|
|
(
|
|
"how_to_earn",
|
|
models.TextField(
|
|
help_text="How to earn the drop.",
|
|
verbose_name="How to Earn",
|
|
),
|
|
),
|
|
("image", models.ImageField(blank=True, upload_to="images/")),
|
|
(
|
|
"start_date",
|
|
models.DateTimeField(
|
|
help_text="The date and time the drop starts.",
|
|
verbose_name="Start Date",
|
|
),
|
|
),
|
|
(
|
|
"end_date",
|
|
models.DateTimeField(
|
|
help_text="The date and time the drop ends.",
|
|
verbose_name="End Date",
|
|
),
|
|
),
|
|
(
|
|
"is_event_based",
|
|
models.BooleanField(
|
|
default=False,
|
|
help_text="If the drop is event based.",
|
|
verbose_name="Event Based",
|
|
),
|
|
),
|
|
(
|
|
"is_time_based",
|
|
models.BooleanField(
|
|
default=False,
|
|
help_text="If the drop is time based.",
|
|
verbose_name="Time Based",
|
|
),
|
|
),
|
|
(
|
|
"account_link_url",
|
|
models.URLField(
|
|
help_text="The URL to link the Twitch account.",
|
|
verbose_name="Connection",
|
|
),
|
|
),
|
|
(
|
|
"participating_channels",
|
|
models.URLField(
|
|
help_text="The URL to the Twitch stream.",
|
|
verbose_name="Participating Channels",
|
|
),
|
|
),
|
|
(
|
|
"status",
|
|
models.BooleanField(
|
|
default=False,
|
|
help_text="If the drop is active.",
|
|
verbose_name="Status",
|
|
),
|
|
),
|
|
(
|
|
"model_created",
|
|
models.DateTimeField(
|
|
auto_now_add=True,
|
|
help_text="The date and time the drop was model_created.",
|
|
),
|
|
),
|
|
(
|
|
"model_updated",
|
|
models.DateTimeField(
|
|
auto_now=True,
|
|
help_text="The date and time the drop was last model_updated.",
|
|
),
|
|
),
|
|
(
|
|
"developer",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="twitch_drops",
|
|
to="twitch_drop_notifier.owner",
|
|
verbose_name="Developer",
|
|
),
|
|
),
|
|
(
|
|
"game",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="twitch_drops",
|
|
to="twitch_drop_notifier.game",
|
|
verbose_name="Game",
|
|
),
|
|
),
|
|
(
|
|
"reward",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="twitch_drops",
|
|
to="twitch_drop_notifier.reward",
|
|
verbose_name="Reward",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Twitch Drop",
|
|
"db_table": "twitch_drop",
|
|
"db_table_comment": "A Twitch Drop.",
|
|
"ordering": ["name"],
|
|
},
|
|
),
|
|
]
|