From 1e3bbbf7d3b2fd12b90bc0dca9ac575de4a7d476 Mon Sep 17 00:00:00 2001 From: Marcel Levstek <62072754+marcellevstek@users.noreply.github.com> Date: Tue, 5 Nov 2024 13:55:39 +0100 Subject: [PATCH] Change ref and alt field types in Variant model --- docs/CHANGELOG.rst | 1 + ...ant_alternative_alter_variant_reference.py | 26 +++++++++++++++++++ resolwe_bio/variants/models.py | 6 ++--- 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 resolwe_bio/variants/migrations/0009_alter_variant_alternative_alter_variant_reference.py diff --git a/docs/CHANGELOG.rst b/docs/CHANGELOG.rst index 92d018291..5b4cd331c 100644 --- a/docs/CHANGELOG.rst +++ b/docs/CHANGELOG.rst @@ -17,6 +17,7 @@ Added Changed ------- +- Change ref and alt field types in Variant model Fixed ----- diff --git a/resolwe_bio/variants/migrations/0009_alter_variant_alternative_alter_variant_reference.py b/resolwe_bio/variants/migrations/0009_alter_variant_alternative_alter_variant_reference.py new file mode 100644 index 000000000..4d62a2978 --- /dev/null +++ b/resolwe_bio/variants/migrations/0009_alter_variant_alternative_alter_variant_reference.py @@ -0,0 +1,26 @@ +# Generated by Django 4.2.13 on 2024-11-05 13:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ( + "resolwe_bio_variants", + "0008_alter_variantannotation_clinical_diagnosis_and_more", + ), + ] + + operations = [ + migrations.AlterField( + model_name="variant", + name="alternative", + field=models.TextField(), + ), + migrations.AlterField( + model_name="variant", + name="reference", + field=models.TextField(), + ), + ] diff --git a/resolwe_bio/variants/models.py b/resolwe_bio/variants/models.py index e3f40566b..19cc9b6f9 100644 --- a/resolwe_bio/variants/models.py +++ b/resolwe_bio/variants/models.py @@ -18,8 +18,6 @@ SPECIES_MAX_LENGTH = 50 GENOME_ASSEMBLY_MAX_LENGTH = 20 CHROMOSOME_MAX_LENGTH = 20 -REFERENCE_MAX_LENGTH = 150 -ALTERNATIVE_MAX_LENGTH = 150 # Metadata VARIANT_DATA_SOURCE_MAX_LENGTH = 100 @@ -66,10 +64,10 @@ class Variant(AuditModel): position = models.PositiveBigIntegerField() #: reference - reference = models.CharField(max_length=REFERENCE_MAX_LENGTH) + reference = models.TextField() #: alternative - alternative = models.CharField(max_length=ALTERNATIVE_MAX_LENGTH) + alternative = models.TextField() class Meta: """Add constraint for composite key."""