# Generated by Django 2.2.25 on 2022-03-03 20:49

from django.db import migrations, models


def populate_os_type(apps, schema_editor):
    # this does not need to be performant.
    FileToProcess = apps.get_model('database', 'FileToProcess')
    for ftp in FileToProcess.objects.all():
        FileToProcess.objects.filter(pk=ftp.pk).update(os_type=ftp.participant.os_type)

class Migration(migrations.Migration):
    
    dependencies = [
        ('database', '0068_survey_name'),
    ]
    
    operations = [
        migrations.AddField(
            model_name='filetoprocess',
            name='os_type',
            field=models.CharField(
                blank=True,
                choices=[('IOS', 'IOS'), ('ANDROID', 'ANDROID'), ('', '')],
                default='',
                max_length=16
            ),
        ),
        migrations.RunPython(populate_os_type, reverse_code=migrations.RunPython.noop),
    ]
