Commit 56a1e793 authored by Marek Szuba's avatar Marek Szuba
Browse files

Initial import from ols-ensembl-loader

last pull: 2019-07-18 13:15 UTC
HEAD at commit: ad833efe2eed3646c891958b011f67af66cde627
last commit pertaining to sql/: 0636a37f2f3cae791cad91f9f7e91893325b4625
parents
-- 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.
-- Adding alt_id table, contains alternative ids for a given term --
CREATE TABLE alt_id (
alt_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
term_id INT UNSIGNED NOT NULL,
accession VARCHAR(64) NOT NULL,
PRIMARY KEY (alt_id),
UNIQUE INDEX term_alt_idx (term_id, alt_id),
INDEX accession_idx (accession(50))
);
-- Patch identifier
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_71_72_b.sql|alt_id table');
-- 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_71_72_c.sql
--
-- Title: Insert schema version.
--
-- Description:
-- Adding schema version to the meta table (set to 72)
-- so that script schema_patcher.pl would work
INSERT INTO meta (meta_key, meta_value)
VALUES ('schema_version', 72);
-- Patch identifier
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_71_72_c.sql|schema_version');
-- 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_71_72_d.sql
--
-- Title: Fix patch versions
--
-- Description:
-- Fixes the existing patch meta items as their versioning was not correct
update meta set meta_value = 'patch_71_72_b.sql|alt_id table'
where meta_key = 'patch'
and meta_value = 'patch_71_72b.sql|alt_id table';
update meta set meta_value = 'patch_71_72_c.sql|schema_version'
where meta_key = 'patch'
and meta_value = 'patch_71_72c.sql|schema_version';
-- Patch identifier
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_71_72_d.sql|patch_version_fix');
-- 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_71_72_e.sql
--
-- Title: Add is_obsolete
--
-- Description:
-- Adds the is_obsolete flag to the term table
ALTER TABLE TERM
ADD COLUMN is_obsolete INT NOT NULL DEFAULT 0;
-- Patch identifier
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_71_72_e.sql|is_obsolete');
-- 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_72_73_a.sql
--
-- Title: Insert schema version.
--
-- Description:
-- Adding schema version to the meta table (set to 73)
-- so that script schema_patcher.pl would work
INSERT INTO meta (meta_key, meta_value)
VALUES ('schema_version', 73);
-- Patch identifier
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_72_73_a.sql|schema_version');
-- 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_72_73_a.sql
--
-- Title: Insert schema version.
--
-- Description:
-- Adding schema version to the meta table (set to 73)
-- so that script schema_patcher.pl would work
ALTER TABLE meta ADD COLUMN species_id INT(1) UNSIGNED DEFAULT NULL;
-- Patch identifier
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_72_73_b.sql|meta_species');
-- 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_73_74_a.sql
--
-- Title: Insert schema version.
--
-- Description:
-- Adding schema version to the meta table (set to 74)
-- so that script schema_patcher.pl would work
INSERT INTO meta (meta_key, meta_value)
VALUES ('schema_version', 74);
-- Patch identifier
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_73_74_a.sql|schema_version');
-- 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_74_75_a.sql
--
-- Title: Insert schema version.
--
-- Description:
-- Adding schema version to the meta table (set to 75)
-- so that script schema_patcher.pl would work
INSERT INTO meta (meta_key, meta_value)
VALUES ('schema_version', 75);
-- Patch identifier
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_74_75_a.sql|schema_version');
-- 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_75_76_a.sql
--
-- Title: Insert schema version.
--
-- Description:
-- Adding schema version to the meta table (set to 76)
-- so that script schema_patcher.pl would work
UPDATE meta SET meta_value='76' WHERE meta_key='schema_version';
-- Patch identifier
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_75_76_a.sql|schema_version');
-- 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_76_77_a.sql
--
-- Title: Insert schema version.
--
-- Description:
-- Adding schema version to the meta table (set to 77)
-- so that script schema_patcher.pl would work
UPDATE meta SET meta_value='77' WHERE meta_key='schema_version';
-- Patch identifier
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_76_77_a.sql|schema_version');
-- 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_77_78_a.sql
--
-- Title: Insert schema version.
--
-- Description:
-- Adding schema version to the meta table (set to 78)
-- so that script schema_patcher.pl would work
UPDATE meta SET meta_value='78' WHERE meta_key='schema_version';
-- Patch identifier
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_77_78_a.sql|schema_version');
-- 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_78_79_a.sql
--
-- Title: Insert schema version.
--
-- Description:
-- Adding schema version to the meta table (set to 79)
-- so that script schema_patcher.pl would work
UPDATE meta SET meta_value='79' WHERE meta_key='schema_version';
-- Patch identifier
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_78_79_a.sql|schema_version');
-- 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_78_79_b.sql
--
-- Title: Add synonym type
--
-- Description:
-- Adds the type of the synonym to the synonym table
ALTER TABLE synonym
ADD COLUMN type ENUM('EXACT', 'BROAD', 'NARROW', 'RELATED');
-- Patch identifier
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_78_79_b.sql|synonym_type');
-- 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_79_80_a.sql
--
-- Title: Insert schema version.
--
-- Description:
-- Adding schema version to the meta table (set to 80)
-- so that script schema_patcher.pl would work
UPDATE meta SET meta_value='80' WHERE meta_key='schema_version';
-- Patch identifier
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_79_80_a.sql|schema_version');
-- 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_80_81_a.sql
#
# Title: Update schema version.
#
# Description:
# Update schema_version in meta table to 81.
UPDATE meta SET meta_value='81' WHERE meta_key='schema_version';
# Patch identifier
INSERT INTO meta (species_id, meta_key, meta_value)
VALUES (NULL, 'patch', 'patch_80_81_a.sql|schema_version');
-- 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_81_82_a.sql
#
# Title: Update schema version.
#
# Description:
# Update schema_version in meta table to 82.
UPDATE meta SET meta_value='82' WHERE meta_key='schema_version';
# Patch identifier
INSERT INTO meta (species_id, meta_key, meta_value)
VALUES (NULL, 'patch', 'patch_81_82_a.sql|schema_version');
-- 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_82_83_a.sql
#
# Title: Update schema version.
#
# Description:
# Update schema_version in meta table to 83.
UPDATE meta SET meta_value='83' WHERE meta_key='schema_version';
# Patch identifier
INSERT INTO meta (species_id, meta_key, meta_value)
VALUES (NULL, 'patch', 'patch_82_83_a.sql|schema_version');
-- 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_83_84_a.sql
#
# Title: Update schema version.
#
# Description:
# Update schema_version in meta table to 84.
UPDATE meta SET meta_value='84' WHERE meta_key='schema_version';
# Patch identifier
INSERT INTO meta (species_id, meta_key, meta_value)
VALUES (NULL, 'patch', 'patch_83_84_a.sql|schema_version');
-- 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_84_85_a.sql
#
# Title: Update schema version.
#
# Description:
# Update schema_version in meta table to 85.
UPDATE meta SET meta_value='85' WHERE meta_key='schema_version';
# Patch identifier
INSERT INTO meta (species_id, meta_key, meta_value)
VALUES (NULL, 'patch', 'patch_84_85_a.sql|schema_version');
-- 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_84_85_b.sql
--
-- Title: Save if it's a confident relationship
--
-- Description:
-- Add a column for to flag if it's a confident relationship
-- (is_a, part_of, occurs_in) when calculating closure.
ALTER TABLE closure
ADD COLUMN confident_relationship BOOL NOT NULL ;
-- Patch identifier
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_84_85_b.sql|confident_relationship');
Markdown is supported
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