Skip to content
Snippets Groups Projects
Verified Commit 7f770ad0 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

feat: add migration to attach notes to existing timeslots

parent 07bb5419
No related branches found
No related tags found
No related merge requests found
# 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)]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment