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

[ENSCORESW-493]. Fixing a number of naming issues in ontology schema. Also had...

[ENSCORESW-493]. Fixing a number of naming issues in ontology schema. Also had to introduce a patch for is_obsolete
parent 2d630640
No related branches found
No related tags found
No related merge requests found
...@@ -12,4 +12,4 @@ CREATE TABLE alt_id ( ...@@ -12,4 +12,4 @@ CREATE TABLE alt_id (
-- Patch identifier -- Patch identifier
INSERT INTO meta (meta_key, meta_value) INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_71_72b.sql|alt_id table'); VALUES ('patch', 'patch_71_72_b.sql|alt_id table');
-- patch_71_72c.sql -- patch_71_72_c.sql
-- --
-- Title: Insert schema version. -- Title: Insert schema version.
-- --
...@@ -11,6 +11,6 @@ INSERT INTO meta (meta_key, meta_value) ...@@ -11,6 +11,6 @@ INSERT INTO meta (meta_key, meta_value)
-- Patch identifier -- Patch identifier
INSERT INTO meta (meta_key, meta_value) INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_71_72c.sql|schema_version'); VALUES ('patch', 'patch_71_72_c.sql|schema_version');
-- patch_71_72_d.sql
--
-- Title: Fix patch versions
--
-- Description:
-- Fixes the existing patch meta items as their versioning was not correct
update meta set meta_value = 'patch_71_72_b.sql|alt_id table'
where meta_key = 'patch'
and meta_value = 'patch_71_72b.sql|alt_id table';
update meta set meta_value = 'patch_71_72_c.sql|schema_version'
where meta_key = 'patch'
and meta_value = 'patch_71_72c.sql|schema_version';
-- Patch identifier
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_71_72_d.sql|patch_version_fix');
-- patch_71_72_e.sql
--
-- Title: Add is_obsolete
--
-- Description:
-- Adds the is_obsolete flag to the term table
ALTER TABLE TERM
ADD COLUMN is_obsolete INT NOT NULL DEFAULT 0;
-- Patch identifier
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_71_72_e.sql|is_obsolete');
...@@ -22,6 +22,10 @@ INSERT INTO meta (meta_key, meta_value) ...@@ -22,6 +22,10 @@ INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_71_72b.sql|alt_id table'); VALUES ('patch', 'patch_71_72b.sql|alt_id table');
INSERT INTO meta (meta_key, meta_value) INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_71_72c.sql|schema_version'); VALUES ('patch', 'patch_71_72c.sql|schema_version');
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_71_72_d.sql|patch_version_fix');
INSERT INTO meta (meta_key, meta_value)
VALUES ('patch', 'patch_71_72_e.sql|is_obsolete');
CREATE TABLE ontology ( CREATE TABLE ontology (
ontology_id INT UNSIGNED NOT NULL AUTO_INCREMENT, ontology_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
...@@ -48,8 +52,8 @@ CREATE TABLE term ( ...@@ -48,8 +52,8 @@ CREATE TABLE term (
accession VARCHAR(64) NOT NULL, accession VARCHAR(64) NOT NULL,
name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL,
definition TEXT, definition TEXT,
is_root INT, is_root INT NOT NULL DEFAULT 0,
is_obsolete INT, is_obsolete INT NOT NULL DEFAULT 0,
PRIMARY KEY (term_id), PRIMARY KEY (term_id),
UNIQUE INDEX accession_idx (accession), UNIQUE INDEX accession_idx (accession),
......
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