# Generated by Django 4.2.14 on 2025-03-04 08:34

import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ("base", "0013_money"),
        (
            "moleculardefinitions",
            "0002_alter_moleculardefinitioncytobandinterval_chromosome_and_more",
        ),
    ]

    operations = [
        migrations.CreateModel(
            name="MolecularDefinitionCoordinateInterval",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="MolecularDefinitionCoordinateIntervalCoordinateSystem",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "end_quantity",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="molecular_definition_coordinate_interval_coordinate_system_end_quantity",
                        to="base.quantity",
                    ),
                ),
                (
                    "end_range",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="molecular_definition_coordinate_interval_coordinate_system_end_range",
                        to="base.range",
                    ),
                ),
                (
                    "normalization_method",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="molecular_definition_coordinate_interval_coordinate_system_method",
                        to="base.codeableconcept",
                    ),
                ),
                (
                    "origin",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="molecular_definition_coordinate_interval_coordinate_system_origin",
                        to="base.codeableconcept",
                    ),
                ),
                (
                    "start_quantity",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="molecular_definition_coordinate_interval_coordinate_system_start_quantity",
                        to="base.quantity",
                    ),
                ),
                (
                    "start_range",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="molecular_definition_coordinate_interval_coordinate_system_start_range",
                        to="base.range",
                    ),
                ),
                (
                    "system",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="molecular_definition_coordinate_interval_coordinate_system_system",
                        to="base.codeableconcept",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.RemoveField(
            model_name="moleculardefinitionsequencelocationcoordinateinternal",
            name="end_quantity",
        ),
        migrations.RemoveField(
            model_name="moleculardefinitionsequencelocationcoordinateinternal",
            name="end_range",
        ),
        migrations.RemoveField(
            model_name="moleculardefinitionsequencelocationcoordinateinternal",
            name="numbering_system",
        ),
        migrations.RemoveField(
            model_name="moleculardefinitionsequencelocationcoordinateinternal",
            name="start_quantity",
        ),
        migrations.RemoveField(
            model_name="moleculardefinitionsequencelocationcoordinateinternal",
            name="start_range",
        ),
        migrations.RenameField(
            model_name="moleculardefinitionrepresentationextracted",
            old_name="string_molecule",
            new_name="starting_molecule",
        ),
        migrations.RemoveField(
            model_name="moleculardefinitionrepresentation",
            name="resolvable",
        ),
        migrations.RemoveField(
            model_name="moleculardefinitionrepresentationextracted",
            name="coordinate_system",
        ),
        migrations.RemoveField(
            model_name="moleculardefinitionrepresentationextracted",
            name="end",
        ),
        migrations.RemoveField(
            model_name="moleculardefinitionrepresentationextracted",
            name="start",
        ),
        migrations.RemoveField(
            model_name="moleculardefinitionrepresentationrelativeedit",
            name="end",
        ),
        migrations.RemoveField(
            model_name="moleculardefinitionrepresentationrelativeedit",
            name="start",
        ),
        migrations.RemoveField(
            model_name="moleculardefinitionsequencelocation",
            name="coordinated_internal",
        ),
        migrations.AddField(
            model_name="moleculardefinition",
            name="description",
            field=models.TextField(null=True),
        ),
        migrations.AddField(
            model_name="moleculardefinition",
            name="molecular_type",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="molecular_definition_molecular_type",
                to="base.codeableconcept",
            ),
        ),
        migrations.AddField(
            model_name="moleculardefinition",
            name="topology",
            field=models.ManyToManyField(
                blank=True,
                related_name="molecular_definition_topology",
                to="base.codeableconcept",
            ),
        ),
        migrations.AddField(
            model_name="moleculardefinitionrepresentationrepeated",
            name="copy_count",
            field=models.IntegerField(null=True),
        ),
        migrations.RemoveField(
            model_name="moleculardefinition",
            name="type",
        ),
        migrations.RemoveField(
            model_name="moleculardefinitionlocation",
            name="featured_location",
        ),
        migrations.AlterField(
            model_name="moleculardefinitionrepresentationrelativeedit",
            name="coordinate_system",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="molecular_representation_coordinate_system",
                to="base.codeableconcept",
            ),
        ),
        migrations.AlterField(
            model_name="moleculardefinitionrepresentationrelativeedit",
            name="replaced_molecule",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="molecular_representation_edit_replaced_molecule",
                to="base.codeableconcept",
            ),
        ),
        migrations.AlterField(
            model_name="moleculardefinitionrepresentationrelativeedit",
            name="replacement_molecule",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="molecular_representation_relative_edit_replacement_molecule",
                to="moleculardefinitions.moleculardefinitionreference",
            ),
        ),
        migrations.DeleteModel(
            name="MolecularDefinitionFeatureLocation",
        ),
        migrations.DeleteModel(
            name="MolecularDefinitionSequenceLocationCoordinateInternal",
        ),
        migrations.AddField(
            model_name="moleculardefinitioncoordinateinterval",
            name="coordinate_system",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="molecular_definition_relative_edit_coordinate_system",
                to="moleculardefinitions.moleculardefinitioncoordinateintervalcoordinatesystem",
            ),
        ),
        migrations.AddField(
            model_name="moleculardefinitionrepresentationextracted",
            name="coordinate_interval",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="molecular_definition_extracted_coordinate_interval",
                to="moleculardefinitions.moleculardefinitioncoordinateinterval",
            ),
        ),
        migrations.AddField(
            model_name="moleculardefinitionrepresentationrelativeedit",
            name="coordinate_interval",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="molecular_representation_relative_edit_coordinate_interval",
                to="moleculardefinitions.moleculardefinitioncoordinateinterval",
            ),
        ),
        migrations.AddField(
            model_name="moleculardefinitionsequencelocation",
            name="coordinated_interval",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="sequence_location_coordinated_internal",
                to="moleculardefinitions.moleculardefinitioncoordinateinterval",
            ),
        ),
        migrations.AddField(
            model_name="moleculardefinition",
            name="type",
            field=models.ManyToManyField(
                blank=True,
                related_name="molecular_definition_type",
                to="base.codeableconcept",
            ),
        ),
        migrations.AddField(
            model_name="moleculardefinitionlocation",
            name="featured_location",
            field=django.contrib.postgres.fields.ArrayField(
                base_field=models.CharField(max_length=255, null=True),
                null=True,
                size=None,
            ),
        ),
    ]
