# Generated by Django 3.1.2 on 2020-10-30 23:37

from django.db import migrations, models
import djapp.models


def gen_key(apps, schema_editor):
    Matching = apps.get_model('djapp', 'Matching')
    for m in Matching.objects.all():
        m.key = djapp.models.random_key_50()
        m.save(update_fields=['key'])


class Migration(migrations.Migration):

    dependencies = [
        ('djapp', '0005_matching'),
    ]

    operations = [
        migrations.RenameField(
            model_name='matching',
            old_name='accepted',
            new_name='coach_accepted',
        ),
        migrations.RenameField(
            model_name='matching',
            old_name='rejected',
            new_name='coach_rejected',
        ),
        migrations.AddField(
            model_name='matching',
            name='host_accepted',
            field=models.DateTimeField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='matching',
            name='host_rejected',
            field=models.DateTimeField(blank=True, null=True),
        ),
        migrations.AlterField(
            model_name='coach',
            name='phone',
            field=models.CharField(blank=True, max_length=20),
        ),
        migrations.AddField(
            model_name='matching',
            name='key',
            field=models.CharField(default='', max_length=50),
        ),
        migrations.RunPython(gen_key, migrations.RunPython.noop),
        migrations.AlterField(
            model_name='matching',
            name='key',
            field=models.CharField(default=djapp.models.random_key_50, max_length=50, unique=True),
        ),
    ]
