-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #247 from MetaCell/feature/AREG-130
Feature/areg-130: Add new antibody status UNDER REVIEW
- Loading branch information
Showing
9 changed files
with
138 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
applications/portal/backend/api/migrations/0011_alter_commercial_type_vendor.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 4.2.9 on 2024-04-21 11:30 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0010_auto_20240315_0451'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='vendor', | ||
name='commercial_type', | ||
field=models.CharField(choices=[('commercial', 'commercial'), ('personal', 'personal'), ('non-profit', 'non-profit'), ('other', 'other')], db_index=True, default='commercial', max_length=32, null=True), | ||
), | ||
] |
97 changes: 97 additions & 0 deletions
97
applications/portal/backend/api/migrations/0012_alter_status_field_antibody_vendordomain.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Generated by Django 4.2.9 on 2024-04-22 10:15 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0011_alter_commercial_type_vendor'), | ||
] | ||
|
||
operations = [ | ||
# First need to drop the MATERIALIZED VIEW antibody_search; | ||
migrations.RunSQL( | ||
sql=""" | ||
DROP MATERIALIZED VIEW IF EXISTS antibody_search; | ||
""", | ||
reverse_sql = """ | ||
DROP MATERIALIZED VIEW antibody_search; | ||
""" | ||
), | ||
migrations.AlterField( | ||
model_name='antibody', | ||
name='status', | ||
field=models.CharField(choices=[('CURATED', 'Curated'), ('REJECTED', 'Rejected'), ('QUEUE', 'Queued'), ('UNDER_REVIEW', 'Under Review')], db_index=True, default='QUEUE', max_length=12), | ||
), | ||
migrations.AlterField( | ||
model_name='vendordomain', | ||
name='status', | ||
field=models.CharField(choices=[('CURATED', 'Curated'), ('REJECTED', 'Rejected'), ('QUEUE', 'Queued'), ('UNDER_REVIEW', 'Under Review')], db_index=True, default='QUEUE', max_length=12), | ||
), | ||
# CREATE THE MATERIALIZED VIEW AGAIN - antibody_search; | ||
migrations.RunSQL( | ||
sql=""" | ||
DROP MATERIALIZED VIEW IF EXISTS antibody_search; | ||
CREATE MATERIALIZED VIEW antibody_search AS | ||
SELECT ix, | ||
( | ||
setweight(to_tsvector('english'::regconfig, ((( | ||
COALESCE(ab_name, ''::text) || ' '::text) || | ||
COALESCE(clone_id, ''::text) || ' '::text)) | ||
), 'A'::"char") || | ||
setweight(to_tsvector('english'::regconfig, ((((((((((((((((((((((((( | ||
COALESCE(api_vendor.vendor, ''::text) || ' '::text) || | ||
COALESCE(api_specie.name, ''::text) || ' '::text) || | ||
COALESCE(target_subregion, ''::text) || ' '::text) || | ||
COALESCE(clonality, ''::text)) || ' '::text) || | ||
COALESCE(target_modification, ''::text)) || ' '::text) || | ||
COALESCE(epitope, ''::character varying)::text) || ' '::text) || | ||
COALESCE(product_isotype, ''::character varying)::text) || ' '::text) || | ||
COALESCE(ab_target, ''::character varying)::text) || ' '::text) || | ||
COALESCE(ab_target_entrez_gid, ''::character varying)::text) || ' '::text) || | ||
COALESCE(uniprot_id, ''::character varying)::text) || ' '::text) || | ||
COALESCE(product_isotype, ''::character varying)::text) || ' '::text) || | ||
COALESCE(product_conjugate, ''::text) || | ||
COALESCE(product_form, ''::character varying)::text) || ' '::text) || | ||
COALESCE(target_species_raw, ''::character varying)::text) || ' '::text) || | ||
COALESCE(kit_contents, ''::character varying)::text) || ' '::text)), 'C'::"char") || | ||
setweight(to_tsvector('english'::regconfig, ((( | ||
COALESCE(comments, ''::text) || ' '::text) || | ||
COALESCE(curator_comment, ''::text) || ' '::text)) | ||
), 'D'::"char") | ||
) AS search_vector, | ||
CASE | ||
WHEN api_antibody.defining_citation ~ '^[0-9,]+$' THEN CAST(SPLIT_PART(api_antibody.defining_citation, ',', 1) AS INTEGER) | ||
ELSE 10000000 | ||
END as defining_citation, | ||
CASE | ||
WHEN disc_date IS NOT NULL THEN 1 | ||
ELSE 0 | ||
END AS disc, | ||
status | ||
FROM api_antibody | ||
LEFT JOIN api_vendor ON api_vendor.id = api_antibody.vendor_id | ||
LEFT JOIN api_specie ON api_specie.id = api_antibody.source_organism_id | ||
""", | ||
reverse_sql = ''' | ||
DROP MATERIALIZED VIEW antibody_search; | ||
''' | ||
), | ||
migrations.RunSQL( | ||
sql="""CREATE UNIQUE INDEX IF NOT EXISTS antibody_search_idx | ||
ON antibody_search | ||
(ix); | ||
""", | ||
), | ||
migrations.AddIndex( | ||
model_name="antibodysearch", | ||
index=django.contrib.postgres.indexes.GinIndex( | ||
fields=["search_vector"], name="antibody_search_fts_idx" | ||
), | ||
) | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters