From a080622b6fc90881abedba43212742efd96611b8 Mon Sep 17 00:00:00 2001 From: Magali Ruffier <mr6@ebi.ac.uk> Date: Tue, 10 May 2016 11:41:48 +0100 Subject: [PATCH] remove duplicated key --- sql/patch_84_85_b.sql | 28 ++++++++++++++++++++++++++++ sql/table.sql | 5 +++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 sql/patch_84_85_b.sql diff --git a/sql/patch_84_85_b.sql b/sql/patch_84_85_b.sql new file mode 100644 index 0000000000..2c66f269ba --- /dev/null +++ b/sql/patch_84_85_b.sql @@ -0,0 +1,28 @@ +-- Copyright [1999-2016] Wellcome Trust Sanger Institute and the 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: Change xref.version default. +# +# Description: +# Remove duplicated keys + +ALTER TABLE genome_statistics DROP KEY stats_idx; +ALTER TABLE xref MODIFY COLUMN version VARCHAR(10) DEFAULT NULL ; + + +# Patch identifier +INSERT INTO meta (species_id, meta_key, meta_value) + VALUES (NULL, 'patch', 'patch_84_85_b.sql|remove_duplicated_key'); diff --git a/sql/table.sql b/sql/table.sql index 728a0dcb15..454a7b32db 100755 --- a/sql/table.sql +++ b/sql/table.sql @@ -227,8 +227,7 @@ CREATE TABLE genome_statistics( timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (genome_statistics_id), - UNIQUE KEY stats_uniq(statistic, attrib_type_id, species_id), - KEY stats_idx (statistic, attrib_type_id, species_id) + UNIQUE KEY stats_uniq(statistic, attrib_type_id, species_id) ) COLLATE=latin1_swedish_ci ENGINE=MyISAM; @@ -309,6 +308,8 @@ INSERT INTO meta (species_id, meta_key, meta_value) VALUES # NOTE: Avoid line-breaks in values. INSERT INTO meta (species_id, meta_key, meta_value) VALUES (NULL, 'patch', 'patch_84_85_a.sql|schema_version'); +INSERT INTO meta (species_id, meta_key, meta_value) + VALUES (NULL, 'patch', 'patch_84_85_b.sql|remove_duplicated_key'); /** -- GitLab