Skip to content

Commit

Permalink
fixed a bug when accessing the variant details page as read only or s…
Browse files Browse the repository at this point in the history
…tandard user
  • Loading branch information
MarvinDo committed Jan 10, 2024
1 parent ce80a09 commit 79bc5ca
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 71 deletions.
2 changes: 2 additions & 0 deletions resources/backups/database_dumper/dump_database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ echo $DATE > most_recent_dump.txt
# information after init_db.py
##mysqldump --quick -h sql.img.med.uni-tuebingen.de -P 3306 -u ahdoebm1 -p --column-statistics=0 --no-tablespaces --no-create-info -r /mnt/storage2/users/ahdoebm1/HerediVar/resources/backups/database_dumper/init_db/init_transcripts.sql HerediVar_ahdoebm1 gene gene_alias transcript exon

##mysqldump --quick -h sql.img.med.uni-tuebingen.de -P 3306 -u ahdoebm1 -p --column-statistics=0 --no-tablespaces -r /mnt/storage2/users/ahdoebm1/HerediVar/resources/backups/database_dumper/init_db/task_force_protein_domains.sql HerediVar_ahdoebm1 task_force_protein_domains


#mysqldump --quick -h SRV011.img.med.uni-tuebingen.de -P 3306 -u ahdoebm1 -p --column-statistics=0 --no-tablespaces --no-create-info -r /mnt/storage2/users/ahdoebm1/HerediVar/resources/backups/database_dumper/init_db/init.sql HerediVar_ahdoebm1 annotation_type classification_criterium classification_criterium_strength classification_scheme mutually_exclusive_criteria gene gene_alias pfam_id_mapping pfam_legacy task_force_protein_domains transcript

Expand Down
144 changes: 74 additions & 70 deletions resources/backups/database_dumper/update_database_3.sql
Original file line number Diff line number Diff line change
Expand Up @@ -178,74 +178,78 @@
-- ;


ALTER TABLE `HerediVar`.`classification_scheme`
ADD COLUMN `version` VARCHAR(45) NOT NULL DEFAULT 'v1.0.0' AFTER `name`;
UPDATE classification_scheme SET version = "v1.4.0" WHERE name = "enigma-tp53";
UPDATE classification_scheme SET version = "v1.1.0" WHERE name = "enigma-ATM";

ALTER TABLE `HerediVar`.`classification_scheme`
CHANGE COLUMN `name` `name` VARCHAR(45) NOT NULL ;


ALTER TABLE `HerediVar`.`classification_scheme`
ADD UNIQUE INDEX `UNIQUE_classification_scheme` (`name` ASC, `version` ASC);
;


ALTER TABLE `HerediVar`.`mutually_inclusive_criteria`
DROP FOREIGN KEY `FK_mutually_inclusive_criteria_source`,
DROP FOREIGN KEY `FK_mutually_inlusive_criteria_target`;
ALTER TABLE `HerediVar`.`mutually_inclusive_criteria`
ADD CONSTRAINT `FK_mutually_inclusive_criteria_source`
FOREIGN KEY (`source`)
REFERENCES `HerediVar`.`classification_criterium` (`id`)
ON DELETE CASCADE
ON UPDATE NO ACTION,
ADD CONSTRAINT `FK_mutually_inlusive_criteria_target`
FOREIGN KEY (`target`)
REFERENCES `HerediVar`.`classification_criterium` (`id`)
ON DELETE CASCADE
ON UPDATE NO ACTION;


CREATE TABLE `HerediVar`.`classification_scheme_alias` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`classification_scheme_id` INT UNSIGNED NOT NULL,
`alias` VARCHAR(45) NOT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;


ALTER TABLE `HerediVar`.`classification_scheme_alias`
ADD INDEX `FK_classification_scheme_alias_classification_scheme_idx` (`classification_scheme_id` ASC);
;
ALTER TABLE `HerediVar`.`classification_scheme_alias`
ADD CONSTRAINT `FK_classification_scheme_alias_classification_scheme`
FOREIGN KEY (`classification_scheme_id`)
REFERENCES `HerediVar`.`classification_scheme` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION;


GRANT SELECT ON HerediVar.classification_scheme_alias TO 'HerediVar_annotation';
GRANT SELECT ON HerediVar.classification_scheme TO 'HerediVar_annotation';
GRANT SELECT,INSERT,UPDATE,DELETE ON HerediVar.classification_scheme_alias TO 'HerediVar_superuser';



ALTER TABLE `HerediVar`.`automatic_classification`
DROP COLUMN `scheme_name`;

ALTER TABLE `HerediVar`.`automatic_classification`
ADD COLUMN `classification_scheme_id` INT UNSIGNED NOT NULL AFTER `variant_id`;
-- ALTER TABLE `HerediVar`.`classification_scheme`
-- ADD COLUMN `version` VARCHAR(45) NOT NULL DEFAULT 'v1.0.0' AFTER `name`;
-- UPDATE classification_scheme SET version = "v1.4.0" WHERE name = "enigma-tp53";
-- UPDATE classification_scheme SET version = "v1.1.0" WHERE name = "enigma-ATM";
--
-- ALTER TABLE `HerediVar`.`classification_scheme`
-- CHANGE COLUMN `name` `name` VARCHAR(45) NOT NULL ;
--
--
-- ALTER TABLE `HerediVar`.`classification_scheme`
-- ADD UNIQUE INDEX `UNIQUE_classification_scheme` (`name` ASC, `version` ASC);
-- ;
--
--
-- ALTER TABLE `HerediVar`.`mutually_inclusive_criteria`
-- DROP FOREIGN KEY `FK_mutually_inclusive_criteria_source`,
-- DROP FOREIGN KEY `FK_mutually_inlusive_criteria_target`;
-- ALTER TABLE `HerediVar`.`mutually_inclusive_criteria`
-- ADD CONSTRAINT `FK_mutually_inclusive_criteria_source`
-- FOREIGN KEY (`source`)
-- REFERENCES `HerediVar`.`classification_criterium` (`id`)
-- ON DELETE CASCADE
-- ON UPDATE NO ACTION,
-- ADD CONSTRAINT `FK_mutually_inlusive_criteria_target`
-- FOREIGN KEY (`target`)
-- REFERENCES `HerediVar`.`classification_criterium` (`id`)
-- ON DELETE CASCADE
-- ON UPDATE NO ACTION;
--
--
-- CREATE TABLE `HerediVar`.`classification_scheme_alias` (
-- `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
-- `classification_scheme_id` INT UNSIGNED NOT NULL,
-- `alias` VARCHAR(45) NOT NULL,
-- PRIMARY KEY (`id`))
-- ENGINE = InnoDB
-- DEFAULT CHARACTER SET = utf8;
--
--
-- ALTER TABLE `HerediVar`.`classification_scheme_alias`
-- ADD INDEX `FK_classification_scheme_alias_classification_scheme_idx` (`classification_scheme_id` ASC);
-- ;
-- ALTER TABLE `HerediVar`.`classification_scheme_alias`
-- ADD CONSTRAINT `FK_classification_scheme_alias_classification_scheme`
-- FOREIGN KEY (`classification_scheme_id`)
-- REFERENCES `HerediVar`.`classification_scheme` (`id`)
-- ON DELETE NO ACTION
-- ON UPDATE NO ACTION;
--
--
-- GRANT SELECT ON HerediVar.classification_scheme_alias TO 'HerediVar_annotation';
-- GRANT SELECT ON HerediVar.classification_scheme TO 'HerediVar_annotation';
-- GRANT SELECT,INSERT,UPDATE,DELETE ON HerediVar.classification_scheme_alias TO 'HerediVar_superuser';
--
--
--
-- ALTER TABLE `HerediVar`.`automatic_classification`
-- DROP COLUMN `scheme_name`;
--
-- ALTER TABLE `HerediVar`.`automatic_classification`
-- ADD COLUMN `classification_scheme_id` INT UNSIGNED NOT NULL AFTER `variant_id`;
--
-- ALTER TABLE `HerediVar`.`automatic_classification`
-- ADD INDEX `FK_autoclass_classification_scheme_idx` (`classification_scheme_id` ASC);
-- ;
-- ALTER TABLE `HerediVar`.`automatic_classification`
-- ADD CONSTRAINT `FK_autoclass_classification_scheme`
-- FOREIGN KEY (`classification_scheme_id`)
-- REFERENCES `HerediVar`.`classification_scheme` (`id`)
-- ON DELETE NO ACTION
-- ON UPDATE NO ACTION;
--

ALTER TABLE `HerediVar`.`automatic_classification`
ADD INDEX `FK_autoclass_classification_scheme_idx` (`classification_scheme_id` ASC);
;
ALTER TABLE `HerediVar`.`automatic_classification`
ADD CONSTRAINT `FK_autoclass_classification_scheme`
FOREIGN KEY (`classification_scheme_id`)
REFERENCES `HerediVar`.`classification_scheme` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION;
GRANT INSERT,UPDATE ON HerediVar.heredivar_clinvar_submissions TO 'HerediVar_user';
GRANT INSERT,UPDATE ON HerediVar.heredivar_clinvar_submissions TO 'HerediVar_read_only';
4 changes: 3 additions & 1 deletion resources/backups/database_dumper/users/user_privileges.sql
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ GRANT SELECT ON HerediVar_ahdoebm1.gene_alias TO 'HerediVar_user';
GRANT SELECT ON HerediVar_ahdoebm1.variant_heredicare_annotation TO 'HerediVar_user';
GRANT SELECT ON HerediVar_ahdoebm1.variant_transcript_annotation TO 'HerediVar_user';
GRANT SELECT ON HerediVar_ahdoebm1.mutually_inclusive_criteria TO 'HerediVar_user';
GRANT INSERT,UPDATE ON HerediVar_ahdoebm1.heredivar_clinvar_submissions TO 'HerediVar_user';

/* grant priviliges to super user */
GRANT SELECT, INSERT, UPDATE ON HerediVar_ahdoebm1.user TO 'HerediVar_superuser';
Expand Down Expand Up @@ -94,4 +95,5 @@ GRANT INSERT, DELETE ON HerediVar_ahdoebm1.list_variants TO 'HerediVar_read_only
GRANT INSERT, UPDATE, DELETE ON HerediVar_ahdoebm1.user_variant_lists TO 'HerediVar_read_only';
GRANT SELECT ON HerediVar_ahdoebm1.gene_alias TO 'HerediVar_read_only';
GRANT SELECT ON HerediVar_ahdoebm1.variant_heredicare_annotation TO 'HerediVar_read_only';
GRANT SELECT ON HerediVar_ahdoebm1.variant_transcript_annotation TO 'HerediVar_read_only';
GRANT SELECT ON HerediVar_ahdoebm1.variant_transcript_annotation TO 'HerediVar_read_only';
GRANT INSERT,UPDATE ON HerediVar.heredivar_clinvar_submissions TO 'HerediVar_read_only';
1 change: 1 addition & 0 deletions src/frontend_celery/webapp/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ <h4>Changelog</h4>
<li>Sometimes, the classification scheme was not changeable in consensus classifications</li>
<li>BRCA1 v1.0.0 PP1 criterium was missing strength selection and PP4 criterium was missing very strong strength</li>
<li>BRCA2 v1.0.0 PP1 and PP4 criteria were missing very strong strength</li>
<li>Fixed a bug when a standard or read only user was accessing the variant details page when a ClinVar submission was unfinished</li>
</ul>
Known issues:
<ul>
Expand Down

0 comments on commit 79bc5ca

Please sign in to comment.