Skip to content

Commit

Permalink
update update database
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinDo committed Feb 21, 2024
1 parent f335128 commit 7d94df8
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions resources/backups/database_dumper/update_database_5.sql
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
ALTER TABLE `HerediVar`.`variant_heredicare_annotation`
ADD COLUMN `lr_cooc` FLOAT NULL AFTER `date`,
ADD COLUMN `lr_coseg` FLOAT NULL AFTER `lr_cooc`,
ADD COLUMN `lr_family` VARCHAR(45) NULL AFTER `lr_coseg`;


ALTER TABLE `HerediVar`.`annotation_type`
ADD COLUMN `is_deleted` TINYINT(1) NOT NULL DEFAULT 0 AFTER `is_transcript_specific`;
-- ALTER TABLE `HerediVar`.`variant_heredicare_annotation`
-- ADD COLUMN `lr_cooc` FLOAT NULL AFTER `date`,
-- ADD COLUMN `lr_coseg` FLOAT NULL AFTER `lr_cooc`,
-- ADD COLUMN `lr_family` VARCHAR(45) NULL AFTER `lr_coseg`;
--
--
-- ALTER TABLE `HerediVar`.`annotation_type`
-- ADD COLUMN `is_deleted` TINYINT(1) NOT NULL DEFAULT 0 AFTER `is_transcript_specific`;


UPDATE annotation_type SET is_deleted = 1 WHERE title = "tp53db_bayes_del";
UPDATE `HerediVar`.`annotation_type` SET is_deleted = 1 WHERE title = "tp53db_bayes_del";


CREATE TABLE `HerediVar`.`variant_cancerhotspots_annotation` (
Expand All @@ -29,7 +29,7 @@ ADD COLUMN `annotation_type_id` INT UNSIGNED NOT NULL AFTER `occurances`;
INSERT INTO `HerediVar`.`annotation_type` (`title`, `display_title`, `description`, `value_type`, `version`, `version_date`, `group_name`, `is_transcript_specific`, `is_deleted`) VALUES ('cancerhotspots', 'cancerhotspots', 'The oncotree symbol, cancertype, tissue and number of occurances form the cancerhotspots database', 'text', 'v2', '2017-12-15', 'None', '0', '0');


UPDATE annotation_type SET is_deleted = 1 WHERE title = "cancerhotspots_cancertypes";
UPDATE `HerediVar`.`annotation_type` SET is_deleted = 1 WHERE title = "cancerhotspots_cancertypes";

GRANT SELECT, INSERT, UPDATE, DELETE ON HerediVar.variant_cancerhotspots_annotation TO 'HerediVar_annotation';
GRANT SELECT ON HerediVar.variant_cancerhotspots_annotation TO 'HerediVar_user';
Expand All @@ -46,15 +46,15 @@ CHANGE COLUMN `cancertype` `cancertype` VARCHAR(500) CHARACTER SET 'utf8mb4' NOT
CHANGE COLUMN `tissue` `tissue` VARCHAR(45) CHARACTER SET 'utf8mb4' NOT NULL ;


UPDATE annotation_type SET group_name = "None" WHERE title = "cancerhotspots_ac";
UPDATE annotation_type SET group_name = "None" WHERE title = "cancerhotspots_af";
UPDATE `HerediVar`.`annotation_type` SET group_name = "None" WHERE title = "cancerhotspots_ac";
UPDATE `HerediVar`.`annotation_type` SET group_name = "None" WHERE title = "cancerhotspots_af";


ALTER TABLE `HerediVar`.`variant_heredicare_annotation`
CHANGE COLUMN `lr_family` `lr_family` FLOAT NULL DEFAULT NULL ;


UPDATE annotation_type SET is_deleted=1 WHERE title="arup_classification"
UPDATE `HerediVar`.`annotation_type` SET is_deleted=1 WHERE title="arup_classification"



Expand Down Expand Up @@ -108,15 +108,15 @@ ALTER TABLE `HerediVar`.`assay_metadata_type`
CHANGE COLUMN `value_type` `value_type` TEXT NOT NULL ;


INSERT INTO `HerediVar`.assay_metadata_type (title, display_title, assay_type_id, value_type) VALUES ('patient_rna', 'Patient RNA', (SELECT id FROM assay_type WHERE title='splicing'), 'bool')
INSERT INTO `HerediVar`.assay_metadata_type (title, display_title, assay_type_id, value_type) VALUES ('minigene', 'Minigene', (SELECT id FROM assay_type WHERE title='splicing'), 'bool')
INSERT INTO `HerediVar`.assay_metadata_type (title, display_title, assay_type_id, value_type) VALUES ('allele_specific', 'Allele-Specific', (SELECT id FROM assay_type WHERE title='splicing'), 'ENUM:True,False,Construct')
INSERT INTO `HerediVar`.assay_metadata_type (title, display_title, assay_type_id, value_type) VALUES ('comment', 'Comment', (SELECT id FROM assay_type WHERE title='splicing'), 'text')
INSERT INTO `HerediVar`.assay_metadata_type (title, display_title, assay_type_id, value_type) VALUES ('score', 'Score', (SELECT id FROM assay_type WHERE title='splicing'), 'float')
INSERT INTO `HerediVar`.assay_metadata_type (title, display_title, assay_type_id, value_type) VALUES ('minimal_percentage', 'Percent aberrant transcript', (SELECT id FROM assay_type WHERE title='splicing'), 'float')
INSERT INTO `HerediVar`.`assay_metadata_type` (title, display_title, assay_type_id, value_type) VALUES ('patient_rna', 'Patient RNA', (SELECT id FROM assay_type WHERE title='splicing'), 'bool')
INSERT INTO `HerediVar`.`assay_metadata_type` (title, display_title, assay_type_id, value_type) VALUES ('minigene', 'Minigene', (SELECT id FROM assay_type WHERE title='splicing'), 'bool')
INSERT INTO `HerediVar`.`assay_metadata_type` (title, display_title, assay_type_id, value_type) VALUES ('allele_specific', 'Allele-Specific', (SELECT id FROM assay_type WHERE title='splicing'), 'ENUM:True,False,Construct')
INSERT INTO `HerediVar`.`assay_metadata_type` (title, display_title, assay_type_id, value_type) VALUES ('comment', 'Comment', (SELECT id FROM assay_type WHERE title='splicing'), 'text')
INSERT INTO `HerediVar`.`assay_metadata_type` (title, display_title, assay_type_id, value_type) VALUES ('score', 'Score', (SELECT id FROM assay_type WHERE title='splicing'), 'float')
INSERT INTO `HerediVar`.`assay_metadata_type` (title, display_title, assay_type_id, value_type) VALUES ('minimal_percentage', 'Percent aberrant transcript', (SELECT id FROM assay_type WHERE title='splicing'), 'float')

INSERT INTO `HerediVar`.assay_metadata_type (title, display_title, assay_type_id, value_type) VALUES ('functional_category', 'Functional category', (SELECT id FROM assay_type WHERE title='functional'), 'ENUM:Pathogenic,Benign,Ambigous')
INSERT INTO `HerediVar`.assay_metadata_type (title, display_title, assay_type_id, value_type) VALUES ('score', 'Score', (SELECT id FROM assay_type WHERE title='functional'), 'float')
INSERT INTO `HerediVar`.`assay_metadata_type` (title, display_title, assay_type_id, value_type) VALUES ('functional_category', 'Functional category', (SELECT id FROM assay_type WHERE title='functional'), 'ENUM:Pathogenic,Benign,Ambigous')
INSERT INTO `HerediVar`.`assay_metadata_type` (title, display_title, assay_type_id, value_type) VALUES ('score', 'Score', (SELECT id FROM assay_type WHERE title='functional'), 'float')


UPDATE `HerediVar`.`assay_metadata_type` SET `is_required` = '0' WHERE (`title` = 'comment');
Expand All @@ -133,7 +133,7 @@ UPDATE assay SET assay_type_id = (SELECT id FROM assay_type WHERE title = 'splic
ALTER TABLE `HerediVar`.`assay`
DROP COLUMN `assay_type`;

INSERT INTO assay_metadata (assay_id, metadata_type_id, value) SELECT id, (SELECT id FROM assay_metadata_type WHERE assay_metadata_type.title = 'score' AND assay_metadata_type.assay_type_id = assay.assay_type_id), score FROM assay
INSERT INTO `HerediVar`.`assay_metadata` (assay_id, metadata_type_id, value) SELECT id, (SELECT id FROM assay_metadata_type WHERE assay_metadata_type.title = 'score' AND assay_metadata_type.assay_type_id = assay.assay_type_id), score FROM assay

ALTER TABLE `HerediVar`.`assay`
DROP COLUMN `score`;
Expand Down Expand Up @@ -249,7 +249,7 @@ DROP PRIMARY KEY,
ADD PRIMARY KEY (`ZID`);
;

INSERT INTO heredicare_ZID (ZID, name) VALUES
INSERT INTO `HerediVar`.`heredicare_ZID` (ZID, name) VALUES
(1, "Berlin"),
(2, "Leipzig"),
(3, "Dresden"),
Expand All @@ -274,7 +274,7 @@ INSERT INTO heredicare_ZID (ZID, name) VALUES
(22, "Erlangen"),
(23, "Halle"),
(24, "Mainz"),
(25, "Lübeck")
(25, "Lübeck");


-- ALTER TABLE `HerediVar`.`heredicare_center_classification`
Expand Down

0 comments on commit 7d94df8

Please sign in to comment.