28 lines
775 B
Python
28 lines
775 B
Python
from django.db import migrations
|
|
|
|
EVENT_PATH = "polylan-43"
|
|
|
|
|
|
def backfill_event(apps, schema_editor):
|
|
Event = apps.get_model("events", "Event")
|
|
LogfileSubmission = apps.get_model("noita", "LogfileSubmission")
|
|
DeathCounter = apps.get_model("noita", "DeathCounter")
|
|
event = Event.objects.get(path=EVENT_PATH)
|
|
LogfileSubmission.objects.filter(event__isnull=True).update(event=event)
|
|
DeathCounter.objects.filter(event__isnull=True).update(event=event)
|
|
|
|
|
|
def noop(apps, schema_editor):
|
|
pass
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
dependencies = [
|
|
("noita", "0013_deathcounter_event_logfilesubmission_event"),
|
|
("events", "0002_seed_polylan_43"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(backfill_event, noop),
|
|
]
|