Skip to content

Commit

Permalink
Merge pull request #273 from bcgsc/feature/DEVSU-2038-add-cancer_gene…
Browse files Browse the repository at this point in the history
…-to-gene

feature/DEVSU-2038-add-cancer_gene-to-gene
  • Loading branch information
Nithriel authored Oct 13, 2023
2 parents c0d436e + 124d6db commit 66a8ea7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/models/reports/genes.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ module.exports = (sequelize, Sq) => {
type: Sq.BOOLEAN,
defaultValue: false,
},
cancerGene: {
field: 'cancer_gene',
type: Sq.BOOLEAN,
},
cancerRelated: {
name: 'cancerRelated',
field: 'cancer_related',
Expand Down
20 changes: 20 additions & 0 deletions migrations/20231012213005-DEVSU-2038-add-cancer_gene-to-gene.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const TABLE = 'reports_genes';

module.exports = {
up: async (queryInterface, Sq) => {
return queryInterface.sequelize.transaction(async (transaction) => {
await queryInterface.addColumn(
TABLE,
'cancer_gene',
{
type: Sq.BOOLEAN,
},
{transaction},
);
});
},

down: async () => {
throw new Error('Not Implemented!');
},
};
4 changes: 3 additions & 1 deletion test/routes/report/gene.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const GENE_DATA = {
knownFusionPartner: true,
therapeuticAssociated: true,
knownSmallMutation: true,
cancerGene: true,
};

const GENE_UPDATE_DATA = {
Expand All @@ -30,12 +31,13 @@ const GENE_UPDATE_DATA = {
knownFusionPartner: false,
therapeuticAssociated: false,
knownSmallMutation: false,
cancerGene: false,
};

const geneProperties = [
'ident', 'createdAt', 'name', 'tumourSuppressor', 'oncogene',
'cancerRelated', 'drugTargetable', 'knownFusionPartner',
'therapeuticAssociated', 'knownSmallMutation',
'therapeuticAssociated', 'knownSmallMutation', 'cancerGene',
];

const checkGene = (geneObject) => {
Expand Down

0 comments on commit 66a8ea7

Please sign in to comment.