mirror of
https://github.com/healthchecks/healthchecks.git
synced 2025-02-22 03:58:36 +00:00
22 lines
590 B
Python
22 lines
590 B
Python
# Generated by Django 5.1.4 on 2024-12-27 10:07
|
|
|
|
import uuid
|
|
from typing import Any
|
|
|
|
from django.apps.registry import Apps
|
|
from django.db import migrations
|
|
|
|
|
|
def fill_badge_key(apps: Apps, schema_editor: Any) -> None:
|
|
Check = apps.get_model("api", "Check")
|
|
for c in Check.objects.filter(badge_key=None):
|
|
c.badge_key = uuid.uuid4()
|
|
c.save(update_fields=["badge_key"])
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
dependencies = [
|
|
("api", "0116_alter_check_badge_key"),
|
|
]
|
|
|
|
operations = [migrations.RunPython(fill_badge_key, migrations.RunPython.noop)]
|