feat: add events app + "multi-tenants" aka multi-events
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
from django.db import migrations
|
||||
|
||||
EVENT_PATH = "polylan-43"
|
||||
|
||||
|
||||
def backfill_event(apps, schema_editor):
|
||||
Event = apps.get_model("events", "Event")
|
||||
SteamCollection = apps.get_model("opus_magnum", "SteamCollection")
|
||||
Submission = apps.get_model("opus_magnum", "Submission")
|
||||
event = Event.objects.get(path=EVENT_PATH)
|
||||
SteamCollection.objects.filter(event__isnull=True).update(event=event)
|
||||
Submission.objects.filter(event__isnull=True).update(event=event)
|
||||
|
||||
|
||||
def noop(apps, schema_editor):
|
||||
pass
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("opus_magnum", "0016_steamcollection_event_submission_event"),
|
||||
("events", "0002_seed_polylan_43"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(backfill_event, noop),
|
||||
]
|
||||
Reference in New Issue
Block a user