# 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', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='MolecularSequenceConcatenatedSequenceElement',
            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)),
                ('ordinate_index', models.IntegerField(null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MolecularSequenceLiteral',
            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)),
                ('sequence_value', models.CharField(max_length=255, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MolecularSequenceConcatenated',
            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)),
                ('sequence_element', models.ManyToManyField(blank=True, related_name='molecular_sequence_concatenated_sequence_element', to='molecularsequences.molecularsequenceconcatenatedsequenceelement')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MolecularSequenceExtracted',
            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)),
                ('start', models.IntegerField(null=True)),
                ('end', models.IntegerField(null=True)),
                ('reverse_complement', models.BooleanField(default=False)),
                ('coordinated_system', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='molecular_sequence_extracted_coordinated_system', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MolecularSequence',
            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)),
                ('type', models.CharField(choices=[('aa', 'Amino acid'), ('dna', 'DNA'), ('rna', 'RNA')], max_length=255, null=True)),
                ('file', models.ManyToManyField(blank=True, related_name='molecular_sequence_file', to='base.attachment')),
                ('identifier', models.ManyToManyField(blank=True, related_name='molecular_sequence_identifier', to='base.identifier')),
                ('concatenated', models.ManyToManyField(blank=True, related_name='molecular_sequence_concatenated', to='molecularsequences.molecularsequenceconcatenated')),
                ('extracted', models.ManyToManyField(blank=True, related_name='molecular_sequence_extracted', to='molecularsequences.molecularsequenceextracted')),
                ('literal', models.ManyToManyField(blank=True, related_name='molecular_sequence_literal', to='molecularsequences.molecularsequenceliteral')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MolecularSequenceReference',
            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.SET_NULL, related_name='molecular_sequence_reference_identifier', to='base.identifier')),
                ('molecular_sequence', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='molecular_sequence_reference_molecular_sequence', to='molecularsequences.molecularsequence')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='molecularsequenceextracted',
            name='starting_sequence',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='molecular_sequence_extracted_starting_sequence', to='molecularsequences.molecularsequencereference'),
        ),
        migrations.AddField(
            model_name='molecularsequenceconcatenatedsequenceelement',
            name='sequence',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='molecular_sequence_concatenated_sequence', to='molecularsequences.molecularsequencereference'),
        ),
        migrations.CreateModel(
            name='MolecularSequenceRelative',
            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_sequence', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='molecular_sequence_relative_starting_sequence', to='molecularsequences.molecularsequencereference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='molecularsequence',
            name='relative',
            field=models.ManyToManyField(blank=True, related_name='molecular_sequence_relative', to='molecularsequences.molecularsequencerelative'),
        ),
        migrations.CreateModel(
            name='MolecularSequenceRelativeEdit',
            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()),
                ('start', models.IntegerField(null=True)),
                ('end', models.IntegerField(null=True)),
                ('coordinate_system', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='molecular_sequence_relative_edit_coordinate_system', to='base.codeableconcept')),
                ('replaced_sequence', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='molecular_sequence_relative_edit_replaced_sequence', to='molecularsequences.molecularsequencereference')),
                ('replacement_sequence', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='molecular_sequence_relative_edit_replacement_sequence', to='molecularsequences.molecularsequencereference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='molecularsequencerelative',
            name='edit',
            field=models.ManyToManyField(blank=True, related_name='molecular_sequence_relative_edit', to='molecularsequences.molecularsequencerelativeedit'),
        ),
        migrations.CreateModel(
            name='MolecularSequenceRepeated',
            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.SET_NULL, related_name='molecular_sequence_repeated_sequence_motif', to='molecularsequences.molecularsequencereference')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='molecularsequence',
            name='repeated',
            field=models.ManyToManyField(blank=True, related_name='molecular_sequence_repeated', to='molecularsequences.molecularsequencerepeated'),
        ),
    ]
