# Generated by Django 2.2.22 on 2021-06-14 15:42

from django.db import migrations


def migrate_data(apps, schema_editor):
    RemoteRepository = apps.get_model('oauth', 'RemoteRepository')
    queryset = RemoteRepository.objects.filter(project__isnull=False).select_related('project')
    for rr in queryset:
        rr.project.remote_repository = rr
        rr.save()


class Migration(migrations.Migration):

    dependencies = [
        ('oauth', '0013_create_new_table_for_remote_repository_normalization'),
        ('projects', '0076_project_remote_repository'),
    ]

    operations = [
        migrations.RunPython(migrate_data),
        migrations.RemoveField(
            model_name='remoterepository',
            name='project',
        ),
    ]

# Generated by Django 2.2.22 on 2021-06-14 15:42

from django.db import migrations


def migrate_data(apps, schema_editor):
    RemoteRepository = apps.get_model('oauth', 'RemoteRepository')
    queryset = RemoteRepository.objects.filter(project__isnull=False).select_related('project')
    for rr in queryset.iterator():
        rr.project.remote_repository = rr
        rr.save()


class Migration(migrations.Migration):

    dependencies = [
        ('oauth', '0013_create_new_table_for_remote_repository_normalization'),
        ('projects', '0076_project_remote_repository'),
    ]

    operations = [
        migrations.RunPython(migrate_data),
        migrations.RemoveField(
            model_name='remoterepository',
            name='project',
        ),
    ]

Update readthedocs/oauth/migrations/0014_remove_remoterepository_project.py