25 lines
575 B
Python
25 lines
575 B
Python
from django.db import migrations
|
|
|
|
EVENT_NAME = "PolyLAN 43"
|
|
EVENT_PATH = "polylan-43"
|
|
|
|
|
|
def seed_event(apps, schema_editor):
|
|
Event = apps.get_model("events", "Event")
|
|
Event.objects.get_or_create(path=EVENT_PATH, defaults={"name": EVENT_NAME})
|
|
|
|
|
|
def unseed_event(apps, schema_editor):
|
|
Event = apps.get_model("events", "Event")
|
|
Event.objects.filter(path=EVENT_PATH).delete()
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
dependencies = [
|
|
("events", "0001_initial"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(seed_event, unseed_event),
|
|
]
|