From b47341cc09f8ff9e47d784274e36b5c31a6200b9 Mon Sep 17 00:00:00 2001 From: Monika Komorowska <mk8@sanger.ac.uk> Date: Mon, 23 Jul 2012 10:42:52 +0000 Subject: [PATCH] schema for xref mindmap db --- .../xref_mapping/xref_mindmap/sql/tables.sql | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 misc-scripts/xref_mapping/xref_mindmap/sql/tables.sql diff --git a/misc-scripts/xref_mapping/xref_mindmap/sql/tables.sql b/misc-scripts/xref_mapping/xref_mindmap/sql/tables.sql new file mode 100644 index 0000000000..58f5bfae22 --- /dev/null +++ b/misc-scripts/xref_mapping/xref_mindmap/sql/tables.sql @@ -0,0 +1,72 @@ +CREATE TABLE external_db_type ( + external_db_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + db_name VARCHAR(100) NOT NULL, + db_display_name VARCHAR(255), + db_type_id INTEGER UNSIGNED, + + PRIMARY KEY (external_db_id), + KEY type_idx (db_type_id, db_name) +) COLLATE=latin1_swedish_ci ENGINE=MyISAM; + + +CREATE TABLE object_xref_linkage ( + external_db_id INTEGER UNSIGNED NOT NULL, + ensembl_object_type VARCHAR(100), + link_type_id INTEGER UNSIGNED NOT NULL, + linked_external_db_id INTEGER UNSIGNED, + linked_node_text VARCHAR(255), + + KEY xref_origin_idx (external_db_id, ensembl_object_type) + +) COLLATE=latin1_swedish_ci ENGINE=MyISAM; + +CREATE TABLE object_external_db_node ( + ensembl_object_type VARCHAR(100) NOT NULL, + external_db_id INTEGER UNSIGNED NOT NULL, + mindmap_tag_id VARCHAR(100) NOT NULL, + + UNIQUE KEY (ensembl_object_type, external_db_id) + +) COLLATE=latin1_swedish_ci ENGINE=MyISAM; + + +CREATE TABLE db_type ( + db_type_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + db_type VARCHAR(255) NOT NULL, + + PRIMARY KEY (db_type_id) +) COLLATE=latin1_swedish_ci ENGINE=MyISAM; + +CREATE TABLE link_type ( + link_type_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + link_type VARCHAR(100) NOT NULL, + link_description VARCHAR(255) NOT NULL, + + PRIMARY KEY (link_type_id), + KEY link_type_idx (link_type) + +) COLLATE=latin1_swedish_ci ENGINE=MyISAM; + +CREATE TABLE object_distance ( + from_object VARCHAR(100) NOT NULL, + to_object VARCHAR(100) NOT NULL, + distance TINYINT(1) UNSIGNED NOT NULL, + + KEY (from_object,distance) + +) COLLATE=latin1_swedish_ci ENGINE=MyISAM; + +LOCK TABLES `object_distance` WRITE; +INSERT INTO `object_distance` VALUES ('Gene','Gene',0), ('Gene','Transcript',1), ('Gene', 'Translation', 2), ('Transcript','Gene',1), ('Transcript','Transcript',0), ('Transcript', 'Translation', 1), ('Translation', 'Gene', 2), ('Translation', 'Transcript',1), ('Translation', 'Translation',0); +UNLOCK TABLES; + +LOCK TABLES `db_type` WRITE; +INSERT INTO `db_type` VALUES (1,'disease related'),(2,'expression'),(3,'integrated information'),(4,'naming'),(5,'products'),(6,'sequence/annotation'),(7,'classification'),(8,'function/location'),(9,'structure'),(10,'other resources'); +UNLOCK TABLES; + +LOCK TABLES `link_type` WRITE; +INSERT INTO `link_type` VALUES (1,'DIRECT', 'DIRECT'),(2,'INFERRED PAIR', 'INFERRED_PAIR'),(3,'DEPENDENT', 'DEPENDENT ON'),(4,'SEQUENCE_MATCH', 'SEQUENCE MATCH'),(5,'COORDINATE_OVERLAP', 'COORDINATE OVERLAP'),(6,'GENERATED_FROM', 'GENERATED FROM'),(7,'PROJECTION','PROJECTION'),(8,'PROTEIN_FEATURES', 'VIA PROTEIN FEATURES'); +UNLOCK TABLES; + + + -- GitLab