Refactor game ownership to support multiple organizations and update related logic

This commit is contained in:
Joakim Hellsén 2026-01-09 21:57:37 +01:00
commit 99e7b40535
No known key found for this signature in database
10 changed files with 99 additions and 64 deletions

View file

@ -0,0 +1,42 @@
# 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
class Migration(migrations.Migration):
"""Allow multiple organizations to own a game.
For example, Rust is owned by both Facepunch Studios and Twitch Gaming.
"""
dependencies = [
("twitch", "0003_remove_dropcampaign_twitch_drop_is_acco_7e9078_idx_and_more"),
]
operations = [
migrations.RemoveIndex(
model_name="game",
name="twitch_game_owner_i_398fa9_idx",
),
migrations.RemoveIndex(
model_name="game",
name="twitch_game_owner_i_7f9043_idx",
),
migrations.AddField(
model_name="game",
name="owners",
field=models.ManyToManyField(
blank=True,
help_text="Organizations that own this game.",
related_name="games",
to="twitch.organization",
verbose_name="Organizations",
),
),
migrations.RemoveField(
model_name="game",
name="owner",
),
]