# Generated by Django 5.2 on 2025-04-23 12:46

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('base', '0005_initial'),
        ('patients', '0002_initial'),
        ('personalrelationships', '0001_initial'),
        ('persons', '0001_initial'),
        ('practitioners', '0001_initial'),
        ('relatedpersons', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='personalrelationshipasserterreference',
            name='practitioner',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationship_asserter_reference_practitioner', to='practitioners.practitioner'),
        ),
        migrations.AddField(
            model_name='personalrelationshipasserterreference',
            name='related_person',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationship_asserter_reference_related_person', to='relatedpersons.relatedperson'),
        ),
        migrations.CreateModel(
            name='PersonalRelationshipTargetReference',
            fields=[
                ('personalrelationshipsourcereference_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='personalrelationships.personalrelationshipsourcereference')),
            ],
            options={
                'abstract': False,
            },
            bases=('personalrelationships.personalrelationshipsourcereference',),
        ),
        migrations.AddField(
            model_name='personalrelationshipsourcereference',
            name='identifier',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationship_source_reference_identifier', to='base.identifier'),
        ),
        migrations.AddField(
            model_name='personalrelationshipsourcereference',
            name='patient',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationship_source_reference_patient', to='patients.patient'),
        ),
        migrations.AddField(
            model_name='personalrelationshipsourcereference',
            name='person',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationship_source_reference_person', to='persons.person'),
        ),
        migrations.AddField(
            model_name='personalrelationshipsourcereference',
            name='related_person',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationship_source_reference_related_person', to='relatedpersons.relatedperson'),
        ),
        migrations.AddField(
            model_name='personalrelationship',
            name='source',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationships_source', to='personalrelationships.personalrelationshipsourcereference'),
        ),
        migrations.AddField(
            model_name='personalrelationship',
            name='target',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='personal_relationships_target', to='personalrelationships.personalrelationshiptargetreference'),
        ),
    ]
