Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Metagenomics
metagenedb
Commits
9b87c9ca
Commit
9b87c9ca
authored
Mar 26, 2021
by
Kenzo-Hugo Hillion
♻
Browse files
set indexes on gene columns
parent
0098e489
Pipeline
#52105
passed with stages
in 4 minutes and 11 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
backend/metagenedb/apps/catalog/migrations/0028_index_source_and_functions.py
0 → 100644
View file @
9b87c9ca
# 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
),
),
]
backend/metagenedb/apps/catalog/models/gene.py
View file @
9b87c9ca
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment