This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
forked from overture-stack/riff
-
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 #15 from kids-first/feat/rename-studies
Add V3__rename_studies_with_KF_prefix.sql migration
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
src/main/resources/flyway/sql/V3__rename_studies_with_KF_prefix.sql
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,39 @@ | ||
/** | ||
* Database migration script for Riff's PostgreSQL database. | ||
* | ||
* This script renames the study names stored in the queries for the cohort builder and the file repository. | ||
* This is done so that the former queries remain valid once the studies have been renamed in the release coordinator. | ||
* | ||
* @date 2019-06-28 | ||
*/ | ||
|
||
/* | ||
* The search queries in the cohort builder are stored as JSON. | ||
* The elements in this list are alphatically sorted. | ||
* We include the initial double quote, to reduce risks of false positives. | ||
*/ | ||
UPDATE riff SET content = REPLACE(content::TEXT, '"Adolescent Idiopathic Scoliosis', '"Kids First: Adolescent Idiopathic Scoliosis')::JSON; | ||
UPDATE riff SET content = REPLACE(content::TEXT, '"Congenital Diaphragmatic Hernia', '"Kids First: Congenital Diaphragmatic Hernia')::JSON; | ||
UPDATE riff SET content = REPLACE(content::TEXT, '"Congenital Hearth Defects', '"Kids First: Congenital Hearth Defects')::JSON; | ||
UPDATE riff SET content = REPLACE(content::TEXT, '"Disorder of Sex Development', '"Kids First: Disorder of Sex Development')::JSON; | ||
UPDATE riff SET content = REPLACE(content::TEXT, '"Ewing Sarcoma: Genetic Risk', '"Kids First: Ewing Sarcoma - Genetic Risk')::JSON; | ||
UPDATE riff SET content = REPLACE(content::TEXT, '"Orofacial Cleft: European Ancestry', '"Kids First: Orofacial Cleft - European Ancestry')::JSON; | ||
UPDATE riff SET content = REPLACE(content::TEXT, '"Orofacial Cleft: Latin American', '"Kids First: Orofacial Cleft - Latin American')::JSON; | ||
UPDATE riff SET content = REPLACE(content::TEXT, '"Pediatric Brain Tumors: CBTTC', '"Consortium: Pediatric Brain Tumors - CBTTC')::JSON; | ||
UPDATE riff SET content = REPLACE(content::TEXT, '"Syndromic Cranial Dysinnervation', '"Kids First: Syndromic Cranial Dysinnervation')::JSON; | ||
|
||
/* | ||
* The search queries in the file repository are stored as their full URL. The SQON is therefore URL-encoded: | ||
* The elements in this list are alphatically sorted. | ||
* We include the initial double quote, to reduce risks of false positives. | ||
*/ | ||
UPDATE riff SET content = REPLACE(content::TEXT, '%22Adolescent%20Idiopathic%20Scoliosis', '%22Kids%20First%3A%20Adolescent%20Idiopathic%20Scoliosis')::JSON; | ||
UPDATE riff SET content = REPLACE(content::TEXT, '%22Congenital%20Diaphragmatic%20Hernia', '%22Kids%20First%3A%20Congenital%20Diaphragmatic%20Hernia')::JSON; | ||
UPDATE riff SET content = REPLACE(content::TEXT, '%22Congenital%20Hearth%20Defects', '%22Kids%20First%3A%20Congenital%20Hearth%20Defects')::JSON; | ||
UPDATE riff SET content = REPLACE(content::TEXT, '%22Disorder%20of%20Sex%20Development', '%22Kids%20First%3A%20Disorder%20of%20Sex%20Development')::JSON; | ||
UPDATE riff SET content = REPLACE(content::TEXT, '%22Ewing%20Sarcoma%3A%20Genetic%20Risk', '%22Kids%20First%3A%20Ewing%20Sarcoma%20-%20Genetic%20Risk')::JSON; | ||
UPDATE riff SET content = REPLACE(content::TEXT, '%22Orofacial%20Cleft:%20European%20Ancestry', '%22Kids%20First%3A%20Orofacial%20Cleft%20-%20European%20Ancestry')::JSON; | ||
UPDATE riff SET content = REPLACE(content::TEXT, '%22Orofacial%20Cleft:%20Latin%20American', '%22Kids%20First%3A%20Orofacial%20Cleft%20-%20Latin%20American')::JSON; | ||
UPDATE riff SET content = REPLACE(content::TEXT, '%22Pediatric%20Brain%20Tumors%3A%20CBTTC', '%22Consortium3A%20Pediatric%20Brain%20Tumors%20-%20CBTTC')::JSON; | ||
UPDATE riff SET content = REPLACE(content::TEXT, '%22Syndromic%20Cranial%20Dysinnervation', '%22Kids%20First%3A%20Syndromic%20Cranial%20Dysinnervation')::JSON; | ||
|