Commit 3b7850f2 authored by Marc Chakiachvili's avatar Marc Chakiachvili
Browse files

Added new patch to update current CHARSET and COLLATE for related tables.

parent 506dcd85
......@@ -21,6 +21,19 @@
-- Added fields to Term and Ontology tables
-- Added columns
ALTER TABLE ontology ADD COLUMN `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL;
ALTER TABLE `ontology` ADD COLUMN `title` varchar(255) DEFAULT NULL;
ALTER TABLE `term` ADD COLUMN `iri` text NULL;
ALTER TABLE `meta` DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE `ontology` DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE `subset` DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE `term` DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE `synonym` DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE term ADD COLUMN `iri` text NULL;
......@@ -20,8 +20,8 @@
CREATE TABLE `meta` (
`meta_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`meta_key` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`meta_value` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
`meta_key` varchar(64) NOT NULL,
`meta_value` varchar(128) DEFAULT NULL,
`species_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`meta_id`),
UNIQUE KEY `key_value_idx` (`meta_key`,`meta_value`)
......@@ -39,10 +39,10 @@ INSERT INTO meta (meta_key, meta_value)
CREATE TABLE `ontology` (
`ontology_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`namespace` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`data_version` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`name` varchar(64) NOT NULL,
`namespace` varchar(64) NOT NULL,
`data_version` varchar(64) DEFAULT NULL,
`title` varchar(255) DEFAULT NULL,
PRIMARY KEY (`ontology_id`),
UNIQUE KEY `ontology_name_namespace_idx` (`name`,`namespace`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
......@@ -50,8 +50,8 @@ CREATE TABLE `ontology` (
CREATE TABLE `subset` (
`subset_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`definition` varchar(511) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`name` varchar(64) NOT NULL,
`definition` varchar(511) NOT NULL DEFAULT '',
PRIMARY KEY (`subset_id`),
UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
......@@ -61,23 +61,23 @@ CREATE TABLE `term` (
`ontology_id` int(10) unsigned NOT NULL,
`subsets` text,
`accession` varchar(64) NOT NULL,
`name` varchar(255) NOT NULL,
`definition` text,
`is_root` int(11) NOT NULL DEFAULT '0',
`is_obsolete` int(11) NOT NULL DEFAULT '0',
`name` varchar(255) COLLATE utf8_general_ci NOT NULL,
`definition` text COLLATE utf8_general_ci,
`is_root` int(11) NOT NULL DEFAULT 0,
`is_obsolete` int(11) NOT NULL DEFAULT 0,
`iri` text,
PRIMARY KEY (`term_id`),
UNIQUE KEY `accession` (`accession`),
UNIQUE KEY `term_ontology_acc_idx` (`ontology_id`,`accession`),
KEY `term_name_idx` (`name`(100))
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `synonym` (
`synonym_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`term_id` int(10) unsigned NOT NULL,
`name` text CHARACTER SET utf8 NOT NULL,
`type` enum('EXACT','BROAD','NARROW','RELATED') COLLATE utf8_unicode_ci DEFAULT NULL,
`dbxref` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
`name` text COLLATE utf8_general_ci NOT NULL,
`type` enum('EXACT','BROAD','NARROW','RELATED') DEFAULT NULL,
`dbxref` varchar(500) DEFAULT NULL,
PRIMARY KEY (`synonym_id`),
UNIQUE KEY `synonym_term_idx` (`term_id`,`synonym_id`),
KEY `synonym_name_idx` (`name`(100))
......@@ -90,14 +90,14 @@ CREATE TABLE `alt_id` (
PRIMARY KEY (`alt_id`),
UNIQUE KEY `term_alt_idx` (`term_id`,`alt_id`),
KEY `ix_alt_id_accession` (`accession`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=MyISAM;
CREATE TABLE `relation_type` (
`relation_type_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(64) NOT NULL,
PRIMARY KEY (`relation_type_id`),
UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=MyISAM;
CREATE TABLE `relation` (
......@@ -112,7 +112,7 @@ CREATE TABLE `relation` (
KEY `ix_relation_parent_term_id` (`parent_term_id`),
KEY `ix_relation_relation_type_id` (`relation_type_id`),
KEY `ix_relation_ontology_id` (`ontology_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=MyISAM;
CREATE TABLE `closure` (
......@@ -128,7 +128,7 @@ CREATE TABLE `closure` (
KEY `ix_closure_subparent_term_id` (`subparent_term_id`),
KEY `ix_closure_ontology_id` (`ontology_id`),
KEY `parent_subparent_idx` (`parent_term_id`,`subparent_term_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=MyISAM;
-- There are additional tables in the released databases called
-- "aux_XX_YY_map". These are created by the "add_subset_maps.pl"
......
......@@ -5,7 +5,7 @@ CREATE TABLE `alt_id` (
PRIMARY KEY (`alt_id`),
UNIQUE KEY `term_alt_idx` (`term_id`,`alt_id`),
KEY `ix_alt_id_accession` (`accession`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM AUTO_INCREMENT=7;
CREATE TABLE `aux_GO_Cross_product_review_map` (
`term_id` int(10) unsigned NOT NULL,
......@@ -132,26 +132,26 @@ CREATE TABLE `closure` (
KEY `ix_closure_subparent_term_id` (`subparent_term_id`),
KEY `ix_closure_ontology_id` (`ontology_id`),
KEY `parent_subparent_idx` (`parent_term_id`,`subparent_term_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1453438 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM AUTO_INCREMENT=1453438;
CREATE TABLE `meta` (
`meta_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`meta_key` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`meta_value` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
`meta_key` varchar(64) NOT NULL,
`meta_value` varchar(128) DEFAULT NULL,
`species_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`meta_id`),
UNIQUE KEY `key_value_idx` (`meta_key`,`meta_value`)
) ENGINE=MyISAM AUTO_INCREMENT=44 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=44;
CREATE TABLE `ontology` (
`ontology_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`namespace` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`data_version` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`name` varchar(64) NOT NULL,
`namespace` varchar(64) NOT NULL,
`data_version` varchar(64) DEFAULT NULL,
`title` varchar(255) DEFAULT NULL,
PRIMARY KEY (`ontology_id`),
UNIQUE KEY `ontology_name_namespace_idx` (`name`,`namespace`)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8;
CREATE TABLE `relation` (
`relation_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
......@@ -165,47 +165,47 @@ CREATE TABLE `relation` (
KEY `ix_relation_parent_term_id` (`parent_term_id`),
KEY `ix_relation_relation_type_id` (`relation_type_id`),
KEY `ix_relation_ontology_id` (`ontology_id`)
) ENGINE=MyISAM AUTO_INCREMENT=68750 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM AUTO_INCREMENT=68750;
CREATE TABLE `relation_type` (
`relation_type_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(64) NOT NULL,
PRIMARY KEY (`relation_type_id`),
UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM AUTO_INCREMENT=85 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM AUTO_INCREMENT=85;
CREATE TABLE `subset` (
`subset_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`definition` varchar(511) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`name` varchar(64) NOT NULL,
`definition` varchar(511) NOT NULL DEFAULT '',
PRIMARY KEY (`subset_id`),
UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=18;
CREATE TABLE `synonym` (
`synonym_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`term_id` int(10) unsigned NOT NULL,
`name` text CHARACTER SET utf8 NOT NULL,
`type` enum('EXACT','BROAD','NARROW','RELATED') COLLATE utf8_unicode_ci DEFAULT NULL,
`dbxref` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
`name` text COLLATE utf8_general_ci NOT NULL,
`type` enum('EXACT','BROAD','NARROW','RELATED') DEFAULT NULL,
`dbxref` varchar(500) DEFAULT NULL,
PRIMARY KEY (`synonym_id`),
UNIQUE KEY `synonym_term_idx` (`term_id`,`synonym_id`),
KEY `synonym_name_idx` (`name`(100))
) ENGINE=MyISAM AUTO_INCREMENT=104283 DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=104283;
CREATE TABLE `term` (
`term_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ontology_id` int(10) unsigned NOT NULL,
`subsets` text,
`accession` varchar(64) NOT NULL,
`name` varchar(255) NOT NULL,
`definition` text,
`is_root` int(11) NOT NULL DEFAULT '0',
`is_obsolete` int(11) NOT NULL DEFAULT '0',
`name` varchar(255) COLLATE utf8_general_ci NOT NULL,
`definition` text COLLATE utf8_general_ci,
`is_root` int(11) NOT NULL DEFAULT 0,
`is_obsolete` int(11) NOT NULL DEFAULT 0,
`iri` text,
PRIMARY KEY (`term_id`),
UNIQUE KEY `accession` (`accession`),
UNIQUE KEY `term_ontology_acc_idx` (`ontology_id`,`accession`),
KEY `term_name_idx` (`name`(100))
) ENGINE=MyISAM AUTO_INCREMENT=45001 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=45001;
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