-
Notifications
You must be signed in to change notification settings - Fork 574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
genetable version added to info api #11290
base: master
Are you sure you want to change the base?
Changes from all commits
990444b
3c6f67a
ada80ef
8677a51
b980ec8
ffd69eb
2e457a7
6465f47
e6e7def
2a7287b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -711,7 +711,8 @@ CREATE TABLE `allele_specific_copy_number` ( | |
-- -------------------------------------------------------- | ||
CREATE TABLE `info` ( | ||
`DB_SCHEMA_VERSION` varchar(24), | ||
`GENESET_VERSION` varchar(24) | ||
`GENESET_VERSION` varchar(24), | ||
`GENE_TABLE_VERSION` varchar(24) | ||
); | ||
|
||
-- -------------------------------------------------------- | ||
|
@@ -755,5 +756,5 @@ CREATE TABLE `resource_study` ( | |
); | ||
|
||
-- THIS MUST BE KEPT IN SYNC WITH db.version PROPERTY IN pom.xml | ||
INSERT INTO info VALUES ('2.13.1', NULL); | ||
INSERT INTO info VALUES ('2.13.1','hgnc_v2023.10.1', NULL ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This version should maybe be |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1027,4 +1027,6 @@ ALTER TABLE `clinical_event_data` MODIFY COLUMN `VALUE` varchar(3000) NOT NULL; | |
CREATE INDEX idx_clinical_event_key ON clinical_event_data (`KEY`); | ||
CREATE INDEX idx_clinical_event_value ON clinical_event_data (`VALUE`); | ||
CREATE INDEX idx_sample_stable_id ON sample (`STABLE_ID`); | ||
ALTER TABLE `info` ADD COLUMN `GENE_TABLE_VERSION` varchar(24); | ||
UPDATE `info` SET `GENE_TABLE_VERSION`="hgnc_v2023.10.1"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here also good if the version is empty or |
||
UPDATE `info` SET `DB_SCHEMA_VERSION`="2.13.1"; |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
[email protected]@ | ||
[email protected]@ | ||
# this is the *expected* DB version (expected by the code). Don't set it manually, it is filled by maven: | ||
[email protected]@ | ||
[email protected]@ | ||
[email protected]@ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
portal.version=test_portal_version | ||
db.version=test_db_version | ||
app.version=test_app_version | ||
genetable.version=test_genetable_version |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,54 @@ | ||
#!/usr/bin/env bash | ||
# halt on error | ||
# Halt on error | ||
set -e | ||
# script dir | ||
|
||
# Script directory | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" | ||
#colors | ||
|
||
# Colors for output | ||
RED='\033[0;31m' | ||
GREEN='\033[0;32m' | ||
YELLOW='\033[1;33m' | ||
NC='\033[0m' | ||
|
||
echo "Making sure all db versions are the same in cgds.sql, pom.xml and migration.sql" | ||
echo "Checking db and genetable versions in pom.xml, cgds.sql, and migration.sql" | ||
|
||
# Fetch db version from pom.xml | ||
POM_DB_VERSION=$(grep '<db.version>' ${DIR}/../pom.xml | cut -d'>' -f2 | cut -d'<' -f1) | ||
echo "pom.xml db version is $POM_DB_VERSION" | ||
|
||
# Fetch geneTable version from pom.xml | ||
POM_GENE_TABLE_VERSION=$(grep '<genetable.version>' ${DIR}/../pom.xml | cut -d'>' -f2 | cut -d'<' -f1) | ||
echo "pom.xml genetable version is $POM_GENE_TABLE_VERSION" | ||
|
||
POM_DB_VERSION=$(grep db.version ${DIR}/../pom.xml | cut -d'>' -f2 | cut -d'<' -f1) | ||
echo pom.xml db version is $POM_DB_VERSION | ||
# Fetch db version from cgds.sql | ||
CGDS_DB_SQL_VERSION=$(grep "INSERT INTO info" ${DIR}/../src/main/resources/db-scripts/cgds.sql | cut -d"'" -f2 | cut -d"'" -f1) | ||
echo "src/main/resources/db-scripts/cgds.sql db version is $CGDS_DB_SQL_VERSION" | ||
|
||
CGDS_DB_SQL_VERSION=$(grep 'INSERT INTO info' ${DIR}/../src/main/resources/db-scripts/cgds.sql | cut -d"'" -f2 | cut -d"'" -f1) | ||
echo src/main/resources/db-scripts/cgds.sql db version is $CGDS_DB_SQL_VERSION | ||
# Fetch geneTable version from cgds.sql | ||
CGDS_GENE_TABLE_VERSION=$(grep "INSERT INTO info" ${DIR}/../src/main/resources/db-scripts/cgds.sql | grep "genetable" | cut -d"'" -f4) | ||
echo "src/main/resources/db-scripts/cgds.sql genetable version is $CGDS_GENE_TABLE_VERSION" | ||
|
||
# Fetch db version from migration.sql | ||
MIGRATION_DB_VERSION=$(grep 'UPDATE `info`' ${DIR}/../src/main/resources/db-scripts/migration.sql | tail -1 | cut -d '"' -f2 | cut -d'"' -f1) | ||
echo src/main/resources/db-scripts/migration.sql db version is $MIGRATION_DB_VERSION | ||
echo "src/main/resources/db-scripts/migration.sql db version is $MIGRATION_DB_VERSION" | ||
|
||
# Fetch geneTable version from migration.sql | ||
MIGRATION_GENE_TABLE_VERSION=$(grep 'UPDATE `info`' ${DIR}/../src/main/resources/db-scripts/migration.sql | tail -1 | cut -d '"' -f4 | cut -d'"' -f1) | ||
echo "src/main/resources/db-scripts/migration.sql genetable version is $MIGRATION_GENE_TABLE_VERSION" | ||
|
||
# Verify db versions match | ||
if [ "$POM_DB_VERSION" == "$CGDS_DB_SQL_VERSION" ] && [ "$CGDS_DB_SQL_VERSION" == "$MIGRATION_DB_VERSION" ]; then | ||
echo -e "${GREEN}db versions match${NC}" | ||
else | ||
echo -e "${RED}db versions mismatch${NC}" | ||
exit 1 | ||
fi | ||
|
||
if [ "$POM_DB_VERSION" == "$CGDS_DB_SQL_VERSION" ] && [ "$CGDS_DB_SQL_VERSION" == "$MIGRATION_DB_VERSION" ] | ||
then | ||
echo -e "${GREEN}db versions match${NC}"; | ||
exit 0; | ||
# Verify geneTable versions match | ||
if [ "$POM_GENE_TABLE_VERSION" == "$CGDS_GENE_TABLE_VERSION" ] && [ "$CGDS_GENE_TABLE_VERSION" == "$MIGRATION_GENE_TABLE_VERSION" ]; then | ||
echo -e "${GREEN}genetable versions match${NC}" | ||
else | ||
echo -e "${RED}db versions mismatch${NC}"; | ||
exit 1; | ||
echo -e "${RED}genetable versions mismatch${NC}" | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rajeswari2904 should this be pulled from the SQL instead? Do we need to hardcode it in the pom?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the
genetable.version
is a bit different fromdb.version
db.version
indicates the version of the SQL schema. The backend is only compatible with a specific version of this schema