diff --git a/program/migrations/0085_attach_notes.py b/program/migrations/0085_attach_notes.py new file mode 100644 index 0000000000000000000000000000000000000000..3d3a9fae5684f6abf48bae74ba41df3b54a58a0d --- /dev/null +++ b/program/migrations/0085_attach_notes.py @@ -0,0 +1,20 @@ +# Generated by Django 4.2.11 on 2024-03-26 22:07 + +from django.db import migrations + + +def attach_notes(apps, _): + Note = apps.get_model("program", "Note") + Timeslot = apps.get_model("program", "TimeSlot") + + for timeslot in Timeslot.objects.filter(note=None): + Note.objects.create(timeslot=timeslot) + timeslot.save() + + +class Migration(migrations.Migration): + dependencies = [ + ("program", "0084_alter_note_title"), + ] + + operations = [migrations.RunPython(code=attach_notes)]