# Generated by Django 2.2.4 on 2020-04-08 17:11

from django.db import migrations

def parse_owners(apps, schema_editor):
    Flat = apps.get_model('property', 'Flat')
    Owner = apps.get_model('property', 'Owner')
    for flat in Flat.objects.all():
        Owner.objects.get_or_create(owner=flat.owner, defaults={
            'owners_phonenumber': flat.owners_phonenumber,
            'pure_phone_number': flat.pure_phone_number
            })


class Migration(migrations.Migration):

    dependencies = [
        ('property', '0013_owner'),
    ]

    operations = [
        migrations.RunPython(parse_owners)
    ]
