# Generated by Django 2.2.13 on 2021-05-19 15:21

from django.db import migrations
import json

def update_feedback_reflection(apps, schema_editor):
    Feedback = apps.get_model("studygroups", "Feedback")

    for feedback in Feedback.objects.exclude(reflection=''):
        new_reflection = {
          'answer': feedback.reflection,
          'promptIndex': 0,
          'prompt': 'Anything else you want to share?',
        }
        feedback.reflection = json.dumps(new_reflection)
        feedback.save()


class Migration(migrations.Migration):

    dependencies = [
        ('studygroups', '0148_auto_20210513_0951'),
    ]

    operations = [
        migrations.RunPython(update_feedback_reflection),
    ]

Add data migration for storing feedback.reflection in updated format
Add data migration for storing feedback.reflection in updated format
