# Generated by Django 2.2.13 on 2020-08-11 17:51

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


def update_pulp_type(apps, schema_editor):
    with transaction.atomic():
        Remote = apps.get_model('core', 'Remote')
        Remote.objects.filter(pulp_type="ansible.ansible").update(pulp_type="ansible.role")


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0039_change_download_concurrency'),
        ('ansible', '0020_auto_20200810_1926'),
    ]

    operations = [
        migrations.RenameModel('AnsibleRemote', 'RoleRemote'),
        migrations.AlterField(
            model_name='roleremote',
            name='remote_ptr',
            field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='ansible_roleremote', serialize=False, to='core.Remote'),
        ),
        migrations.RunPython(update_pulp_type),
    ]
