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

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('base', '0003_initial'),
        ('documentreferences', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='MolecularDefinitionCytobandIntervalStartEndCytoband',
            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)),
                ('arm_code', models.CharField(max_length=255, null=True)),
                ('arm_string', models.CharField(max_length=255, null=True)),
                ('region_code', models.CharField(max_length=255, null=True)),
                ('region_string', models.CharField(max_length=255, null=True)),
                ('band_code', models.CharField(max_length=255, null=True)),
                ('band_string', models.CharField(max_length=255, null=True)),
                ('sub_band_code', models.CharField(max_length=255, null=True)),
                ('sub_band_string', models.CharField(max_length=255, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MolecularDefinitionRepresentationConcatenated',
            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.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)),
                ('coordinate_system', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='molecular_definition_relative_edit_coordinate_system', to='moleculardefinitions.moleculardefinitioncoordinateintervalcoordinatesystem')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MolecularDefinitionCytobandInterval',
            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)),
                ('chromosome', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='cytoband_interval_chromosome', to='base.codeableconcept')),
                ('end_cytoband', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='cytoband_interval_end_cytoband', to='moleculardefinitions.moleculardefinitioncytobandintervalstartendcytoband')),
                ('start_cytoband', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='cytoband_interval_start_cytoband', to='moleculardefinitions.moleculardefinitioncytobandintervalstartendcytoband')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MolecularDefinitionCytobandLocation',
            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)),
                ('cytoband_interval', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='cytoband_location_cytoband_interval', to='moleculardefinitions.moleculardefinitioncytobandinterval')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MolecularDefinitionLocation',
            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)),
                ('featured_location', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=255, null=True), null=True, size=None)),
                ('cytoband_location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='molecular_definition_cytoband_location', to='moleculardefinitions.moleculardefinitioncytobandlocation')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MolecularDefinition',
            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)),
                ('description', models.TextField(null=True)),
                ('identifier', models.ManyToManyField(blank=True, related_name='molecular_definition_identifier', to='base.identifier')),
                ('molecular_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='molecular_definition_molecular_type', to='base.codeableconcept')),
                ('topology', models.ManyToManyField(blank=True, related_name='molecular_definition_topology', to='base.codeableconcept')),
                ('type', models.ManyToManyField(blank=True, related_name='molecular_definition_type', to='base.codeableconcept')),
                ('location', models.ManyToManyField(blank=True, related_name='molecular_definition_location', to='moleculardefinitions.moleculardefinitionlocation')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MolecularDefinitionReference',
            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)),
                ('reference', models.CharField(max_length=255, null=True)),
                ('type', models.CharField(max_length=255, null=True)),
                ('display', models.CharField(max_length=255, null=True)),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='molecular_definition_reference_identifier', to='base.identifier')),
                ('molecular_definition', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='molecular_definition_reference_molecular_definition', to='moleculardefinitions.moleculardefinition')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='moleculardefinition',
            name='member_state',
            field=models.ManyToManyField(blank=True, related_name='molecular_definition_member_state', to='moleculardefinitions.moleculardefinitionreference'),
        ),
        migrations.CreateModel(
            name='MolecularDefinitionRepresentation',
            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)),
                ('code', models.ManyToManyField(blank=True, related_name='representation_code', to='base.codeableconcept')),
                ('focus', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='representation_focus', to='base.codeableconcept')),
                ('resolvable', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='representation_resolvable', to='documentreferences.documentreferencereference')),
                ('concatenated', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='representation_concatenated', to='moleculardefinitions.moleculardefinitionrepresentationconcatenated')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='moleculardefinition',
            name='representation',
            field=models.ManyToManyField(blank=True, related_name='molecular_definition_representation', to='moleculardefinitions.moleculardefinitionrepresentation'),
        ),
        migrations.CreateModel(
            name='MolecularDefinitionRepresentationConcatenatedSequenceElement',
            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)),
                ('ordinal_index', models.IntegerField(null=True)),
                ('sequence', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='representation_concatenated_sequence_element_sequence', to='moleculardefinitions.moleculardefinitionreference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='moleculardefinitionrepresentationconcatenated',
            name='sequence_element',
            field=models.ManyToManyField(blank=True, related_name='representation_concatenated', to='moleculardefinitions.moleculardefinitionrepresentationconcatenatedsequenceelement'),
        ),
        migrations.CreateModel(
            name='MolecularDefinitionRepresentationExtracted',
            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)),
                ('reverse_complement', models.BooleanField(default=False)),
                ('coordinate_interval', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='molecular_definition_extracted_coordinate_interval', to='moleculardefinitions.moleculardefinitioncoordinateinterval')),
                ('starting_molecule', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='representation_extract_string_molecule', to='moleculardefinitions.moleculardefinitionreference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='moleculardefinitionrepresentation',
            name='extracted',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='representation_extracted', to='moleculardefinitions.moleculardefinitionrepresentationextracted'),
        ),
        migrations.CreateModel(
            name='MolecularDefinitionRepresentationLiteral',
            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)),
                ('value', models.CharField(max_length=255, null=True)),
                ('encoding', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='representation_literal_encoding', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='moleculardefinitionrepresentation',
            name='literal',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='representation_literal', to='moleculardefinitions.moleculardefinitionrepresentationliteral'),
        ),
        migrations.CreateModel(
            name='MolecularDefinitionRepresentationRelative',
            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)),
                ('starting_molecule', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='representation_starting_molecule', to='moleculardefinitions.moleculardefinitionreference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='moleculardefinitionrepresentation',
            name='relative',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='representation_relative', to='moleculardefinitions.moleculardefinitionrepresentationrelative'),
        ),
        migrations.CreateModel(
            name='MolecularDefinitionRepresentationRelativeEdit',
            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)),
                ('edit_order', models.IntegerField(null=True)),
                ('coordinate_interval', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='molecular_representation_relative_edit_coordinate_interval', to='moleculardefinitions.moleculardefinitioncoordinateinterval')),
                ('coordinate_system', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='molecular_representation_coordinate_system', to='base.codeableconcept')),
                ('replaced_molecule', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='molecular_representation_edit_replaced_molecule', to='base.codeableconcept')),
                ('replacement_molecule', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='molecular_representation_relative_edit_replacement_molecule', to='moleculardefinitions.moleculardefinitionreference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='moleculardefinitionrepresentationrelative',
            name='edit',
            field=models.ManyToManyField(blank=True, related_name='representation_edit_relative', to='moleculardefinitions.moleculardefinitionrepresentationrelativeedit'),
        ),
        migrations.CreateModel(
            name='MolecularDefinitionRepresentationRepeated',
            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)),
                ('copy_count', models.IntegerField(null=True)),
                ('sequence_motif', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='representation_extract_sequence_motif', to='moleculardefinitions.moleculardefinitionreference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='moleculardefinitionrepresentation',
            name='repeated',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='representation_repeat', to='moleculardefinitions.moleculardefinitionrepresentationrepeated'),
        ),
        migrations.CreateModel(
            name='MolecularDefinitionSequenceLocation',
            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)),
                ('coordinated_interval', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='sequence_location_coordinated_internal', to='moleculardefinitions.moleculardefinitioncoordinateinterval')),
                ('sequence_context', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='sequence_location_sequence_context', to='moleculardefinitions.moleculardefinitionreference')),
                ('strand', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='sequence_location_strand', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='moleculardefinitionlocation',
            name='sequence_location',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='molecular_definition_sequence_location', to='moleculardefinitions.moleculardefinitionsequencelocation'),
        ),
        migrations.CreateModel(
            name='MolecularSequenceGenomeAssembly',
            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)),
                ('description_markdown', models.TextField(null=True)),
                ('description_string', models.CharField(max_length=255, null=True)),
                ('accession', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='genome_assembly_accession', to='base.codeableconcept')),
                ('build', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='genome_assembly_build', to='base.codeableconcept')),
                ('organism', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='genome_assembly_organism', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='moleculardefinitioncytobandlocation',
            name='genome_assembly',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='cytoband_location_genome_assembly', to='moleculardefinitions.molecularsequencegenomeassembly'),
        ),
    ]
