Skip to content

Commit

Permalink
Merge pull request #363 from Ensembl/schema_update_97
Browse files Browse the repository at this point in the history
Schema update 97
  • Loading branch information
mkszuba committed Feb 15, 2019
2 parents c128a35 + cd2c910 commit 5308e4c
Show file tree
Hide file tree
Showing 46 changed files with 361 additions and 263 deletions.
6 changes: 5 additions & 1 deletion misc-scripts/ontology/sql/patch_95_96_b.sql
Expand Up @@ -40,4 +40,8 @@ CREATE INDEX ix_closure_ontology_id ON closure (`ontology_id`);

CREATE INDEX `ix_relation_parent_term_id` ON relation (`parent_term_id`);
CREATE INDEX `ix_relation_relation_type_id` ON relation (`relation_type_id`);
CREATE INDEX `ix_relation_ontology_id` ON relation (`ontology_id`);
CREATE INDEX `ix_relation_ontology_id` ON relation (`ontology_id`);

-- Patch identifier
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_95_96_b.sql|term_ontology_update');
27 changes: 27 additions & 0 deletions misc-scripts/ontology/sql/patch_96_97_a.sql
@@ -0,0 +1,27 @@
-- Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
-- Copyright [2016-2019] EMBL-European Bioinformatics Institute
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

# patch_96_97_a.sql
#
# Title: Update schema version.
#
# Description:
# Update schema_version in meta table to 97.

UPDATE meta SET meta_value='97' WHERE meta_key='schema_version';

# Patch identifier
INSERT INTO meta (species_id, meta_key, meta_value)
VALUES (NULL, 'patch', 'patch_96_97_a.sql|schema_version');
5 changes: 2 additions & 3 deletions misc-scripts/ontology/sql/tables.sql
Expand Up @@ -30,12 +30,11 @@ CREATE TABLE `meta` (
# Add schema type and schema version to the meta table
INSERT INTO meta (meta_key, meta_value) VALUES
('schema_type', 'ontology'),
('schema_version', '96');
('schema_version', '97');

# Patches included in this schema file
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_95_96_a.sql|schema_version');

VALUES ('patch', 'patch_96_97_a.sql|schema_version');

CREATE TABLE `ontology` (
`ontology_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
Expand Down
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/ApiVersion.pm
Expand Up @@ -56,7 +56,7 @@ use base qw( Exporter );

our @EXPORT = qw( software_version );

my $API_VERSION = 96;
my $API_VERSION = 97;

sub software_version { return $API_VERSION }

Expand Down
2 changes: 1 addition & 1 deletion modules/t/test-genome-DBs/circ/core/SQLite/table.sql
@@ -1,6 +1,6 @@
--
-- Created by SQL::Translator::Producer::SQLite
-- Created on Thu Dec 6 13:49:32 2018
-- Created on Tue Feb 12 11:45:04 2019
--

BEGIN TRANSACTION;
Expand Down
3 changes: 2 additions & 1 deletion modules/t/test-genome-DBs/circ/core/meta.txt
Expand Up @@ -39,7 +39,7 @@
95 \N patch patch_83_84_c.sql|protein_feature_unique
96 \N patch patch_83_84_d.sql|longer_synonym
1 \N schema_type core
2 \N schema_version 96
2 \N schema_version 97
8 1 assembly.accession GCA_000292705.1
10 1 assembly.date 2012-08
7 1 assembly.default GCA_000292705.1
Expand Down Expand Up @@ -126,3 +126,4 @@
126 \N patch patch_94_95_b.sql|vertebrate_division_rename
127 \N patch patch_94_95_c.sql|ox_key_update
128 \N patch patch_95_96_a.sql|schema_version
129 \N patch patch_96_97_a.sql|schema_version
2 changes: 1 addition & 1 deletion modules/t/test-genome-DBs/circ/core/table.sql
Expand Up @@ -489,7 +489,7 @@ CREATE TABLE `meta` (
PRIMARY KEY (`meta_id`),
UNIQUE KEY `species_key_value_idx` (`species_id`,`meta_key`,`meta_value`),
KEY `species_value_idx` (`species_id`,`meta_value`)
) ENGINE=MyISAM AUTO_INCREMENT=129 DEFAULT CHARSET=latin1;
) ENGINE=MyISAM AUTO_INCREMENT=130 DEFAULT CHARSET=latin1;

CREATE TABLE `meta_coord` (
`table_name` varchar(40) COLLATE latin1_bin NOT NULL DEFAULT '',
Expand Down
@@ -1,6 +1,6 @@
--
-- Created by SQL::Translator::Producer::SQLite
-- Created on Thu Dec 6 13:49:43 2018
-- Created on Tue Feb 12 11:45:08 2019
--

BEGIN TRANSACTION;
Expand Down
3 changes: 2 additions & 1 deletion modules/t/test-genome-DBs/homo_sapiens/core/meta.txt
@@ -1,4 +1,4 @@
1 \N schema_version 96
1 \N schema_version 97
2 1 assembly.default NCBI34
3 1 species.taxonomy_id 9606
26 1 species.classification Homo sapiens
Expand Down Expand Up @@ -105,3 +105,4 @@
172 \N patch patch_94_95_b.sql|vertebrate_division_rename
173 \N patch patch_94_95_c.sql|ox_key_update
174 \N patch patch_95_96_a.sql|schema_version
175 \N patch patch_96_97_a.sql|schema_version
2 changes: 1 addition & 1 deletion modules/t/test-genome-DBs/homo_sapiens/core/table.sql
Expand Up @@ -489,7 +489,7 @@ CREATE TABLE `meta` (
PRIMARY KEY (`meta_id`),
UNIQUE KEY `species_key_value_idx` (`species_id`,`meta_key`,`meta_value`),
KEY `species_value_idx` (`species_id`,`meta_value`)
) ENGINE=MyISAM AUTO_INCREMENT=175 DEFAULT CHARSET=latin1;
) ENGINE=MyISAM AUTO_INCREMENT=176 DEFAULT CHARSET=latin1;

CREATE TABLE `meta_coord` (
`table_name` varchar(40) COLLATE latin1_bin NOT NULL DEFAULT '',
Expand Down
@@ -1,6 +1,6 @@
--
-- Created by SQL::Translator::Producer::SQLite
-- Created on Thu Dec 6 13:49:54 2018
-- Created on Tue Feb 12 11:45:11 2019
--

BEGIN TRANSACTION;
Expand Down
3 changes: 2 additions & 1 deletion modules/t/test-genome-DBs/homo_sapiens/empty/meta.txt
@@ -1,4 +1,4 @@
1 \N schema_version 96
1 \N schema_version 97
2 1 assembly.default NCBI34
33 1 species.classification Chordata
32 1 species.classification Vertebrata
Expand Down Expand Up @@ -105,3 +105,4 @@
154 \N patch patch_94_95_b.sql|vertebrate_division_rename
155 \N patch patch_94_95_c.sql|ox_key_update
156 \N patch patch_95_96_a.sql|schema_version
157 \N patch patch_96_97_a.sql|schema_version
2 changes: 1 addition & 1 deletion modules/t/test-genome-DBs/homo_sapiens/empty/table.sql
Expand Up @@ -489,7 +489,7 @@ CREATE TABLE `meta` (
PRIMARY KEY (`meta_id`),
UNIQUE KEY `species_key_value_idx` (`species_id`,`meta_key`,`meta_value`),
KEY `species_value_idx` (`species_id`,`meta_value`)
) ENGINE=MyISAM AUTO_INCREMENT=157 DEFAULT CHARSET=latin1;
) ENGINE=MyISAM AUTO_INCREMENT=158 DEFAULT CHARSET=latin1;

CREATE TABLE `meta_coord` (
`table_name` varchar(40) COLLATE latin1_bin NOT NULL DEFAULT '',
Expand Down
@@ -1,6 +1,6 @@
--
-- Created by SQL::Translator::Producer::SQLite
-- Created on Thu Dec 6 13:50:04 2018
-- Created on Tue Feb 12 11:45:14 2019
--

BEGIN TRANSACTION;
Expand Down
3 changes: 2 additions & 1 deletion modules/t/test-genome-DBs/homo_sapiens/patch/meta.txt
@@ -1,4 +1,4 @@
1 \N schema_version 96
1 \N schema_version 97
2014 1 species.classification Haplorrhini
40 1 assembly.default GRCh37
41 1 assembly.date 2009-02
Expand Down Expand Up @@ -110,3 +110,4 @@
2117 \N patch patch_94_95_b.sql|vertebrate_division_rename
2118 \N patch patch_94_95_c.sql|ox_key_update
2119 \N patch patch_95_96_a.sql|schema_version
2120 \N patch patch_96_97_a.sql|schema_version
2 changes: 1 addition & 1 deletion modules/t/test-genome-DBs/homo_sapiens/patch/table.sql
Expand Up @@ -489,7 +489,7 @@ CREATE TABLE `meta` (
PRIMARY KEY (`meta_id`),
UNIQUE KEY `species_key_value_idx` (`species_id`,`meta_key`,`meta_value`),
KEY `species_value_idx` (`species_id`,`meta_value`)
) ENGINE=MyISAM AUTO_INCREMENT=2120 DEFAULT CHARSET=latin1;
) ENGINE=MyISAM AUTO_INCREMENT=2121 DEFAULT CHARSET=latin1;

CREATE TABLE `meta_coord` (
`table_name` varchar(40) COLLATE latin1_bin NOT NULL DEFAULT '',
Expand Down
Expand Up @@ -17,3 +17,5 @@
18 Supporting evidence can not be re-mapped to the current assembly
19 Variant maps to more than one genomic location
20 Variant at first base in sequence
21 Reference allele does not match the bases at this genome location
22 Alleles cannot be resolved
4 changes: 4 additions & 0 deletions modules/t/test-genome-DBs/homo_sapiens/variation/meta.txt
Expand Up @@ -35,3 +35,7 @@
35 \N patch patch_94_95_a.sql|schema version
36 \N patch patch_94_95_b.sql|create table to store allele synonyms
37 \N patch patch_95_96_a.sql|schema_version
38 \N patch patch_95_96_b.sql|modify index on variation_synonym
39 \N patch patch_95_96_c.sql|add new entries to the failed_description table
40 \N patch patch_95_96_d.sql|create table to store failed variation features
41 \N patch patch_95_96_e.sql|Rename motif_name to binding_matrix_stable_id.
16 changes: 12 additions & 4 deletions modules/t/test-genome-DBs/homo_sapiens/variation/table.sql
Expand Up @@ -113,7 +113,7 @@ CREATE TABLE `failed_description` (
`failed_description_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`description` text NOT NULL,
PRIMARY KEY (`failed_description_id`)
) ENGINE=MyISAM AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;
) ENGINE=MyISAM AUTO_INCREMENT=23 DEFAULT CHARSET=latin1;

CREATE TABLE `failed_structural_variation` (
`failed_structural_variation_id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -131,6 +131,14 @@ CREATE TABLE `failed_variation` (
UNIQUE KEY `variation_idx` (`variation_id`,`failed_description_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `failed_variation_feature` (
`failed_variation_feature_id` int(11) NOT NULL AUTO_INCREMENT,
`variation_feature_id` int(10) unsigned NOT NULL,
`failed_description_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`failed_variation_feature_id`),
UNIQUE KEY `variation_feature_idx` (`variation_feature_id`,`failed_description_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `genotype_code` (
`genotype_code_id` int(11) unsigned NOT NULL,
`allele_code_id` int(11) unsigned NOT NULL,
Expand Down Expand Up @@ -178,7 +186,7 @@ CREATE TABLE `meta` (
PRIMARY KEY (`meta_id`),
UNIQUE KEY `species_key_value_idx` (`species_id`,`meta_key`,`meta_value`),
KEY `species_value_idx` (`species_id`,`meta_value`)
) ENGINE=MyISAM AUTO_INCREMENT=38 DEFAULT CHARSET=latin1;
) ENGINE=MyISAM AUTO_INCREMENT=42 DEFAULT CHARSET=latin1;

CREATE TABLE `meta_coord` (
`table_name` varchar(40) NOT NULL,
Expand All @@ -195,7 +203,7 @@ CREATE TABLE `motif_feature_variation` (
`allele_string` text,
`somatic` tinyint(1) NOT NULL DEFAULT '0',
`consequence_types` set('TF_binding_site_variant','TFBS_ablation','TFBS_fusion','TFBS_amplification','TFBS_translocation') DEFAULT NULL,
`motif_name` varchar(60) DEFAULT NULL,
`binding_matrix_stable_id` varchar(60) DEFAULT NULL,
`motif_start` int(11) unsigned DEFAULT NULL,
`motif_end` int(11) unsigned DEFAULT NULL,
`motif_score_delta` float DEFAULT NULL,
Expand Down Expand Up @@ -675,7 +683,7 @@ CREATE TABLE `variation_synonym` (
`source_id` int(10) unsigned NOT NULL,
`name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`variation_synonym_id`),
UNIQUE KEY `name` (`name`,`source_id`),
UNIQUE KEY `name_idx` (`name`,`source_id`,`variation_id`),
KEY `variation_idx` (`variation_id`),
KEY `subsnp_idx` (`subsnp_id`),
KEY `source_idx` (`source_id`)
Expand Down
@@ -1,6 +1,6 @@
--
-- Created by SQL::Translator::Producer::SQLite
-- Created on Thu Dec 6 13:50:07 2018
-- Created on Tue Feb 12 11:45:15 2019
--

BEGIN TRANSACTION;
Expand Down
2 changes: 1 addition & 1 deletion modules/t/test-genome-DBs/mapping/core/SQLite/table.sql
@@ -1,6 +1,6 @@
--
-- Created by SQL::Translator::Producer::SQLite
-- Created on Thu Dec 6 13:50:17 2018
-- Created on Tue Feb 12 11:45:18 2019
--

BEGIN TRANSACTION;
Expand Down
3 changes: 2 additions & 1 deletion modules/t/test-genome-DBs/mapping/core/meta.txt
@@ -1,4 +1,4 @@
1 \N schema_version 96
1 \N schema_version 97
2 1 assembly.default MULTIMAP
3 1 species.taxonomy_id 1
4 1 assembly.mapping chromosome:MULTIMAP#contig
Expand Down Expand Up @@ -66,3 +66,4 @@
159 \N patch patch_94_95_b.sql|vertebrate_division_rename
160 \N patch patch_94_95_c.sql|ox_key_update
161 \N patch patch_95_96_a.sql|schema_version
162 \N patch patch_96_97_a.sql|schema_version
2 changes: 1 addition & 1 deletion modules/t/test-genome-DBs/mapping/core/table.sql
Expand Up @@ -489,7 +489,7 @@ CREATE TABLE `meta` (
PRIMARY KEY (`meta_id`),
UNIQUE KEY `species_key_value_idx` (`species_id`,`meta_key`,`meta_value`),
KEY `species_value_idx` (`species_id`,`meta_value`)
) ENGINE=MyISAM AUTO_INCREMENT=162 DEFAULT CHARSET=latin1;
) ENGINE=MyISAM AUTO_INCREMENT=163 DEFAULT CHARSET=latin1;

CREATE TABLE `meta_coord` (
`table_name` varchar(40) COLLATE latin1_bin NOT NULL DEFAULT '',
Expand Down
2 changes: 1 addition & 1 deletion modules/t/test-genome-DBs/multi/compara/SQLite/table.sql
@@ -1,6 +1,6 @@
--
-- Created by SQL::Translator::Producer::SQLite
-- Created on Thu Dec 6 13:50:26 2018
-- Created on Tue Feb 12 11:45:21 2019
--

BEGIN TRANSACTION;
Expand Down
@@ -1,6 +1,6 @@
--
-- Created by SQL::Translator::Producer::SQLite
-- Created on Thu Dec 6 13:50:36 2018
-- Created on Tue Feb 12 11:45:24 2019
--

BEGIN TRANSACTION;
Expand Down
3 changes: 2 additions & 1 deletion modules/t/test-genome-DBs/mus_musculus/core/meta.txt
@@ -1,5 +1,5 @@
1 \N schema_type core
2 \N schema_version 96
2 \N schema_version 97
3 \N patch patch_65_66_a.sql|schema_version
4 \N patch patch_65_66_b.sql|fix_external_db_id
5 \N patch patch_65_66_c.sql|reorder_unmapped_obj_index
Expand Down Expand Up @@ -183,3 +183,4 @@
1695 \N patch patch_94_95_b.sql|vertebrate_division_rename
1696 \N patch patch_94_95_c.sql|ox_key_update
1697 \N patch patch_95_96_a.sql|schema_version
1698 \N patch patch_96_97_a.sql|schema_version
2 changes: 1 addition & 1 deletion modules/t/test-genome-DBs/mus_musculus/core/table.sql
Expand Up @@ -489,7 +489,7 @@ CREATE TABLE `meta` (
PRIMARY KEY (`meta_id`),
UNIQUE KEY `species_key_value_idx` (`species_id`,`meta_key`,`meta_value`),
KEY `species_value_idx` (`species_id`,`meta_value`)
) ENGINE=MyISAM AUTO_INCREMENT=1698 DEFAULT CHARSET=latin1;
) ENGINE=MyISAM AUTO_INCREMENT=1699 DEFAULT CHARSET=latin1;

CREATE TABLE `meta_coord` (
`table_name` varchar(40) COLLATE latin1_bin NOT NULL DEFAULT '',
Expand Down
Expand Up @@ -17,3 +17,5 @@
18 Supporting evidence can not be re-mapped to the current assembly
19 Variant maps to more than one genomic location
20 Variant at first base in sequence
21 Reference allele does not match the bases at this genome location
22 Alleles cannot be resolved
4 changes: 4 additions & 0 deletions modules/t/test-genome-DBs/mus_musculus/variation/meta.txt
Expand Up @@ -62,3 +62,7 @@
68 \N patch patch_94_95_a.sql|schema version
69 \N patch patch_94_95_b.sql|create table to store allele synonyms
70 \N patch patch_95_96_a.sql|schema_version
71 \N patch patch_95_96_b.sql|modify index on variation_synonym
72 \N patch patch_95_96_c.sql|add new entries to the failed_description table
73 \N patch patch_95_96_d.sql|create table to store failed variation features
74 \N patch patch_95_96_e.sql|Rename motif_name to binding_matrix_stable_id.
16 changes: 12 additions & 4 deletions modules/t/test-genome-DBs/mus_musculus/variation/table.sql
Expand Up @@ -113,7 +113,7 @@ CREATE TABLE `failed_description` (
`failed_description_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`description` text NOT NULL,
PRIMARY KEY (`failed_description_id`)
) ENGINE=MyISAM AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;
) ENGINE=MyISAM AUTO_INCREMENT=23 DEFAULT CHARSET=latin1;

CREATE TABLE `failed_structural_variation` (
`failed_structural_variation_id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -131,6 +131,14 @@ CREATE TABLE `failed_variation` (
UNIQUE KEY `variation_idx` (`variation_id`,`failed_description_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `failed_variation_feature` (
`failed_variation_feature_id` int(11) NOT NULL AUTO_INCREMENT,
`variation_feature_id` int(10) unsigned NOT NULL,
`failed_description_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`failed_variation_feature_id`),
UNIQUE KEY `variation_feature_idx` (`variation_feature_id`,`failed_description_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `genotype_code` (
`genotype_code_id` int(11) unsigned NOT NULL,
`allele_code_id` int(11) unsigned NOT NULL,
Expand Down Expand Up @@ -178,7 +186,7 @@ CREATE TABLE `meta` (
PRIMARY KEY (`meta_id`),
UNIQUE KEY `species_key_value_idx` (`species_id`,`meta_key`,`meta_value`),
KEY `species_value_idx` (`species_id`,`meta_value`)
) ENGINE=MyISAM AUTO_INCREMENT=71 DEFAULT CHARSET=latin1;
) ENGINE=MyISAM AUTO_INCREMENT=75 DEFAULT CHARSET=latin1;

CREATE TABLE `meta_coord` (
`table_name` varchar(40) NOT NULL,
Expand All @@ -195,7 +203,7 @@ CREATE TABLE `motif_feature_variation` (
`allele_string` text,
`somatic` tinyint(1) NOT NULL DEFAULT '0',
`consequence_types` set('TF_binding_site_variant','TFBS_ablation','TFBS_fusion','TFBS_amplification','TFBS_translocation') DEFAULT NULL,
`motif_name` varchar(60) DEFAULT NULL,
`binding_matrix_stable_id` varchar(60) DEFAULT NULL,
`motif_start` int(11) unsigned DEFAULT NULL,
`motif_end` int(11) unsigned DEFAULT NULL,
`motif_score_delta` float DEFAULT NULL,
Expand Down Expand Up @@ -681,7 +689,7 @@ CREATE TABLE `variation_synonym` (
`source_id` int(10) unsigned NOT NULL,
`name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`variation_synonym_id`),
UNIQUE KEY `name` (`name`,`source_id`),
UNIQUE KEY `name_idx` (`name`,`source_id`,`variation_id`),
KEY `variation_idx` (`variation_id`),
KEY `subsnp_idx` (`subsnp_id`),
KEY `source_idx` (`source_id`)
Expand Down
2 changes: 1 addition & 1 deletion modules/t/test-genome-DBs/nameless/core/SQLite/table.sql
@@ -1,6 +1,6 @@
--
-- Created by SQL::Translator::Producer::SQLite
-- Created on Thu Dec 6 13:50:47 2018
-- Created on Tue Feb 12 11:45:27 2019
--

BEGIN TRANSACTION;
Expand Down
3 changes: 2 additions & 1 deletion modules/t/test-genome-DBs/nameless/core/meta.txt
@@ -1,4 +1,4 @@
1 \N schema_version 96
1 \N schema_version 97
2 1 assembly.default NCBI34
3 1 species.taxonomy_id 9606
26 1 species.classification Homo sapiens
Expand Down Expand Up @@ -104,3 +104,4 @@
158 \N patch patch_94_95_b.sql|vertebrate_division_rename
159 \N patch patch_94_95_c.sql|ox_key_update
160 \N patch patch_95_96_a.sql|schema_version
161 \N patch patch_96_97_a.sql|schema_version

0 comments on commit 5308e4c

Please sign in to comment.