From 44e5145fe69218cca28ba94cc0fa4817b9d3ec4c Mon Sep 17 00:00:00 2001
From: Andrew Yates <ayates@ebi.ac.uk>
Date: Wed, 6 Jun 2012 10:15:39 +0000
Subject: [PATCH] Typo for region

---
 .../core/intron_supporting_evidence.sql       | 15 +++++++
 sql/patch_67_68_c.sql                         | 39 +++++++++++++++++++
 sql/table.sql                                 |  2 +-
 3 files changed, 55 insertions(+), 1 deletion(-)
 create mode 100644 modules/t/test-genome-DBs/homo_sapiens/core/intron_supporting_evidence.sql
 create mode 100644 sql/patch_67_68_c.sql

diff --git a/modules/t/test-genome-DBs/homo_sapiens/core/intron_supporting_evidence.sql b/modules/t/test-genome-DBs/homo_sapiens/core/intron_supporting_evidence.sql
new file mode 100644
index 0000000000..f50e44cc78
--- /dev/null
+++ b/modules/t/test-genome-DBs/homo_sapiens/core/intron_supporting_evidence.sql
@@ -0,0 +1,15 @@
+CREATE TABLE intron_supporting_evidence (
+intron_supporting_evidence_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+analysis_id                   SMALLINT UNSIGNED NOT NULL,
+seq_region_id                 INT(10) UNSIGNED NOT NULL,
+seq_region_start              INT(10) UNSIGNED NOT NULL,
+seq_region_end                INT(10) UNSIGNED NOT NULL,
+seq_region_strand             TINYINT(2) NOT NULL,
+hit_name                      VARCHAR(100) NOT NULL,
+score                         DECIMAL(10,3),
+score_type                    ENUM('NONE', 'DEPTH') DEFAULT 'NONE',
+
+PRIMARY KEY (intron_supporting_evidence_id),
+
+UNIQUE KEY (analysis_id, seq_region_id, seq_region_start, seq_region_end, seq_region_strand, hit_name)
+) COLLATE=latin1_swedish_ci ENGINE=MyISAM;
diff --git a/sql/patch_67_68_c.sql b/sql/patch_67_68_c.sql
new file mode 100644
index 0000000000..255ef0afa3
--- /dev/null
+++ b/sql/patch_67_68_c.sql
@@ -0,0 +1,39 @@
+# patch_67_68_c.sql
+#
+# Title: Altering intron_supporting_evidence table
+#
+# Description: Introns can be supported by an external feature. This gives a 
+# weight to how much we believe the intron and allows the attachement to
+# a transcript whilst letting the intron exist on its own and 
+# queryable by location
+# 
+
+DROP TABLE intron_supporting_evidence;
+
+CREATE TABLE intron_supporting_evidence (
+intron_supporting_evidence_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+analysis_id                   SMALLINT UNSIGNED NOT NULL,
+seq_region_id                 INT(10) UNSIGNED NOT NULL,
+seq_region_start              INT(10) UNSIGNED NOT NULL,
+seq_region_end                INT(10) UNSIGNED NOT NULL,
+seq_region_strand             TINYINT(2) NOT NULL,
+hit_name                      VARCHAR(100) NOT NULL,
+score                         DECIMAL(10,3),
+score_type                    ENUM('NONE', 'DEPTH') DEFAULT 'NONE',
+
+PRIMARY KEY (intron_supporting_evidence_id),
+
+UNIQUE KEY (analysis_id, seq_region_id, seq_region_start, seq_region_end, seq_region_strand, hit_name)
+) COLLATE=latin1_swedish_ci ENGINE=MyISAM;
+
+CREATE TABLE transcript_intron_supporting_evidence (
+transcript_id                 INT(10) UNSIGNED NOT NULL,
+intron_supporting_evidence_id INT(10) UNSIGNED NOT NULL,
+previous_exon_id              INT(10) UNSIGNED NOT NULL,
+next_exon_id                  INT(10) UNSIGNED NOT NULL,
+PRIMARY KEY (intron_supporting_evidence_id, transcript_id)
+) COLLATE=latin1_swedish_ci ENGINE=MyISAM;
+
+# Patch identifier:
+INSERT INTO meta (species_id, meta_key, meta_value)
+  VALUES (NULL, 'patch', 'patch_67_68_c.sql|altering_intron_supporting_evidence');
\ No newline at end of file
diff --git a/sql/table.sql b/sql/table.sql
index f43e61ef19..417c8b787e 100755
--- a/sql/table.sql
+++ b/sql/table.sql
@@ -292,7 +292,7 @@ score_type                    ENUM('NONE', 'DEPTH') DEFAULT 'NONE',
 
 PRIMARY KEY (intron_supporting_evidence_id),
 
-UNIQUE KEY (analysis_id, seq_region_id, seq_region_start, seq_reigon_end, seq_region_strand, hit_name)
+UNIQUE KEY (analysis_id, seq_region_id, seq_region_start, seq_region_end, seq_region_strand, hit_name)
 ) COLLATE=latin1_swedish_ci ENGINE=MyISAM;
 
 /**
-- 
GitLab