Skip to content
Snippets Groups Projects
Commit cba55729 authored by Andy Yates's avatar Andy Yates
Browse files

[ENSCORESW-694]. Adding a unique constraint to alt_allele(gene_id).

Seems that our earlier design was incorrect and we do want to only
have 1 gene in 1 alt allele group. So adding the constraint in.
parent 33633123
No related branches found
No related tags found
No related merge requests found
# patch_73_74_h.sql
#
# Title: Creating a unique index on alt_allele(gene_id)
#
# Description:
#
# Alt alleles only allow a gene to appear in one group. Enforce this
# at the DB level
CREATE UNIQUE INDEX gene_idx ON alt_allele(gene_id);
# patch identifier
INSERT INTO meta (species_id, meta_key, meta_value) VALUES (NULL, 'patch', 'patch_73_74_h.sql|alt_allele_unique_gene_idx');
......@@ -274,6 +274,8 @@ INSERT INTO meta (species_id, meta_key, meta_value)
VALUES (NULL, 'patch', 'patch_73_74_f.sql|remove_pair_dna_align');
INSERT INTO meta (species_id, meta_key, meta_value)
VALUES (NULL, 'patch', 'patch_73_74_g.sql|add_transcript_idx_tise');
INSERT INTO meta (species_id, meta_key, meta_value)
VALUES (NULL, 'patch', 'patch_73_74_h.sql|alt_allele_unique_gene_idx');
/**
@table meta_coord
......@@ -405,6 +407,7 @@ CREATE TABLE alt_allele (
gene_id INT UNSIGNED NOT NULL,
PRIMARY KEY (alt_allele_id),
UNIQUE KEY gene_idx (gene_id),
KEY (gene_id,alt_allele_group_id)
) COLLATE=latin1_swedish_ci ENGINE=MyISAM;
......
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