From c136c0b9e360b1308041fdc7554aa5a7e520f6b1 Mon Sep 17 00:00:00 2001
From: Alessandro Vullo <avullo@ebi.ac.uk>
Date: Thu, 4 Dec 2014 09:56:44 +0000
Subject: [PATCH] Patches for 79: schema version and synonym type.

---
 misc-scripts/ontology/sql/patch_78_79_a.sql | 29 +++++++++++++++++++++
 misc-scripts/ontology/sql/patch_78_79_b.sql | 29 +++++++++++++++++++++
 misc-scripts/ontology/sql/tables.sql        |  7 +++--
 3 files changed, 63 insertions(+), 2 deletions(-)
 create mode 100644 misc-scripts/ontology/sql/patch_78_79_a.sql
 create mode 100644 misc-scripts/ontology/sql/patch_78_79_b.sql

diff --git a/misc-scripts/ontology/sql/patch_78_79_a.sql b/misc-scripts/ontology/sql/patch_78_79_a.sql
new file mode 100644
index 0000000000..9e25e39d20
--- /dev/null
+++ b/misc-scripts/ontology/sql/patch_78_79_a.sql
@@ -0,0 +1,29 @@
+-- Copyright [1999-2014] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
+-- 
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+-- 
+--      http://www.apache.org/licenses/LICENSE-2.0
+-- 
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+
+-- patch_78_79_a.sql
+--
+-- Title: Insert schema version.
+--
+-- Description:
+--   Adding schema version to the meta table (set to 79)
+--   so that script schema_patcher.pl would work
+
+UPDATE meta SET meta_value='79' WHERE meta_key='schema_version';
+
+-- Patch identifier
+INSERT INTO meta (meta_key, meta_value)
+  VALUES ('patch', 'patch_78_79_a.sql|schema_version');
+
+
diff --git a/misc-scripts/ontology/sql/patch_78_79_b.sql b/misc-scripts/ontology/sql/patch_78_79_b.sql
new file mode 100644
index 0000000000..be593ec942
--- /dev/null
+++ b/misc-scripts/ontology/sql/patch_78_79_b.sql
@@ -0,0 +1,29 @@
+-- Copyright [1999-2014] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
+-- 
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+-- 
+--      http://www.apache.org/licenses/LICENSE-2.0
+-- 
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+
+-- patch_78_79_b.sql
+--
+-- Title: Add synonym type
+--
+-- Description:
+--   Adds the type of the synonym to the synonym table
+
+ALTER TABLE SYNONYM
+ADD COLUMN type ENUM('EXACT', 'BROAD', 'NARROW', 'RELATED');
+
+-- Patch identifier
+INSERT INTO meta (meta_key, meta_value)
+  VALUES ('patch', 'patch_78_79_b.sql|synonym_type');
+
+
diff --git a/misc-scripts/ontology/sql/tables.sql b/misc-scripts/ontology/sql/tables.sql
index 5f075793dc..a3d824c790 100644
--- a/misc-scripts/ontology/sql/tables.sql
+++ b/misc-scripts/ontology/sql/tables.sql
@@ -30,11 +30,14 @@ CREATE TABLE meta (
 # Add schema type and schema version to the meta table
 INSERT INTO meta (meta_key, meta_value) VALUES 
   ('schema_type', 'ontology'),
-  ('schema_version', '78');
+  ('schema_version', '79');
 
 # Patches included in this schema file
 INSERT INTO meta (meta_key, meta_value)
-  VALUES ('patch', 'patch_77_78_a.sql|schema_version');
+  VALUES ('patch', 'patch_78_79_a.sql|schema_version');
+
+INSERT INTO meta (meta_key, meta_value)
+  VALUES ('patch', 'patch_78_79_b.sql|synonym_type');
 
 CREATE TABLE ontology (
   ontology_id   INT UNSIGNED NOT NULL AUTO_INCREMENT,
-- 
GitLab