Skip to content
Snippets Groups Projects
Commit 9c7e3bb2 authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion :recycle:
Browse files

Merge branch 'improve-db-queries' into 'dev'

set indexes on gene columns

See merge request !70
parents 0098e489 9b87c9ca
No related branches found
No related tags found
1 merge request!70set indexes on gene columns
Pipeline #52106 passed
# Generated by Django 3.1.7 on 2021-03-26 13:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalog', '0027_fix_deprecated_jsonfield'),
]
operations = [
migrations.AlterField(
model_name='gene',
name='functions',
field=models.ManyToManyField(db_index=True, through='catalog.GeneFunction', to='catalog.Function'),
),
migrations.AlterField(
model_name='gene',
name='source',
field=models.CharField(choices=[('undef', 'Undefined'), ('igc', 'IGC'), ('virgo', 'Virgo')], db_index=True, default='undef', max_length=10),
),
]
......@@ -24,13 +24,13 @@ class Gene(models.Model):
name = models.CharField(max_length=100, unique=True)
sequence = models.TextField(blank=True)
length = models.PositiveIntegerField(db_index=True)
functions = models.ManyToManyField(Function, through='GeneFunction')
functions = models.ManyToManyField(Function, db_index=True, through='GeneFunction')
taxonomy = models.ForeignKey(
'Taxonomy', related_name='genes',
on_delete=models.SET_NULL,
null=True, blank=True
)
source = models.CharField(max_length=10, choices=SOURCE_CHOICES, default=UNDEFINED)
source = models.CharField(max_length=10, db_index=True, choices=SOURCE_CHOICES, default=UNDEFINED)
def __str__(self) -> str:
return self.gene_id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment