-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/sql/migrations/20240918171424_rename_last_params_seurat.js
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,25 @@ | ||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.up = async (knex) => { | ||
// Update the last_pipeline_params to set sampleTechnology to seurat_object where it is currently seurat | ||
await knex('experiment_execution') | ||
.where({ pipeline_type: 'obj2s' }) | ||
.update({ | ||
last_pipeline_params: knex.raw("jsonb_set(last_pipeline_params::jsonb, '{sampleTechnology}', '\"seurat_object\"'::jsonb)"), | ||
}); | ||
}; | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.down = async (knex) => { | ||
// Revert sampleTechnology back to seurat | ||
await knex('experiment_execution') | ||
.where({ pipeline_type: 'obj2s' }) | ||
.update({ | ||
last_pipeline_params: knex.raw("jsonb_set(last_pipeline_params::jsonb, '{sampleTechnology}', '\"seurat\"'::jsonb)"), | ||
}); | ||
}; |