14 lines
453 B
Python
14 lines
453 B
Python
from django.db import migrations
|
|
from django.utils import timezone
|
|
|
|
|
|
def create_scoring_epoch(apps, schema_editor):
|
|
ScoringEpoch = apps.get_model("gamification", "ScoringEpoch")
|
|
ScoringEpoch.objects.get_or_create(pk=1, defaults={"started_at": timezone.now()})
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
dependencies = [("gamification", "0001_initial")]
|
|
|
|
operations = [migrations.RunPython(create_scoring_epoch, migrations.RunPython.noop)]
|