Skip to content
Snippets Groups Projects
Commit 787af0d0 authored by Matthew Laird's avatar Matthew Laird Committed by GitHub
Browse files

Merge pull request #162 from thomasmaurel/ontology_db_patch_87

New schema patches to allow the ensembl_ontology schema to work on ne…
parents 46e776fb 2d7801a1
No related branches found
No related tags found
No related merge requests found
-- Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
-- Copyright [2016] 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_86_87_b.sql
#
# Title: Increase dbxref field length
#
# Description:
# Update synonym table to increase size of dbxref column
ALTER TABLE synonym MODIFY COLUMN dbxref VARCHAR(256) NOT NULL;
# Patch identifier
INSERT INTO meta (species_id, meta_key, meta_value)
VALUES (NULL, 'patch', 'patch_86_87_b.sql|longer_dbxref');
-- Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
-- Copyright [2016] 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_86_87_c.sql
#
# Title: Increase dbxref field length
#
# Description:
# Update synonym table to allow UTF8 Unicode characters
ALTER TABLE synonym CONVERT TO CHARACTER SET utf8 COLLATE utf8_swedish_ci;
# Patch identifier
INSERT INTO meta (species_id, meta_key, meta_value)
VALUES (NULL, 'patch', 'patch_86_87_c.sql|make_table_utf8');
-- Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
-- Copyright [2016] 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_86_87_d.sql
#
# Title: Default value for confident_relationship
#
# Description:
# Adding default value for the confident_relationship column in the closure table
ALTER TABLE closure ALTER COLUMN confident_relationship SET DEFAULT 0;
# Patch identifier
INSERT INTO meta (species_id, meta_key, meta_value)
VALUES (NULL, 'patch', 'patch_86_87_d.sql|default_value_confident_relationship');
......@@ -35,7 +35,7 @@ INSERT INTO meta (meta_key, meta_value) VALUES
# Patches included in this schema file
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_86_87_a.sql|schema_version');
VALUES ('patch', 'patch_86_87_d.sql|default_value_confident_relationship');
CREATE TABLE ontology (
......@@ -78,12 +78,12 @@ CREATE TABLE synonym (
term_id INT UNSIGNED NOT NULL,
name TEXT NOT NULL,
type ENUM('EXACT', 'BROAD', 'NARROW', 'RELATED'),
dbxref VARCHAR(64) NULL,
dbxref VARCHAR(258) NULL,
PRIMARY KEY (synonym_id),
UNIQUE INDEX term_synonym_idx (term_id, synonym_id),
INDEX name_idx (name(50))
) COLLATE=latin1_swedish_ci ENGINE=MyISAM;
) COLLATE=utf8_swedish_ci ENGINE=MyISAM;
CREATE TABLE alt_id (
alt_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
......@@ -124,7 +124,7 @@ CREATE TABLE closure (
subparent_term_id INT UNSIGNED,
distance TINYINT UNSIGNED NOT NULL,
ontology_id INT UNSIGNED NOT NULL,
confident_relationship BOOL NOT NULL,
confident_relationship BOOL NOT NULL DEFAULT 0,
PRIMARY KEY (closure_id),
UNIQUE INDEX child_parent_idx
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment