diff --git a/app/models/reports/genes.js b/app/models/reports/genes.js index b1ec2ca05..7d0d0ed1d 100644 --- a/app/models/reports/genes.js +++ b/app/models/reports/genes.js @@ -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', diff --git a/migrations/20231012213005-DEVSU-2038-add-cancer_gene-to-gene.js b/migrations/20231012213005-DEVSU-2038-add-cancer_gene-to-gene.js new file mode 100644 index 000000000..4574d3d9c --- /dev/null +++ b/migrations/20231012213005-DEVSU-2038-add-cancer_gene-to-gene.js @@ -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!'); + }, +}; diff --git a/test/routes/report/gene.test.js b/test/routes/report/gene.test.js index ab9f0113c..ae25bffee 100644 --- a/test/routes/report/gene.test.js +++ b/test/routes/report/gene.test.js @@ -19,6 +19,7 @@ const GENE_DATA = { knownFusionPartner: true, therapeuticAssociated: true, knownSmallMutation: true, + cancerGene: true, }; const GENE_UPDATE_DATA = { @@ -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) => {