From 387d1a95997d108348b33b6c94fe5cb2cb12d8fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kusalananda=20K=C3=A4h=C3=A4ri?= <ak4@sanger.ac.uk> Date: Thu, 28 May 2009 12:30:36 +0000 Subject: [PATCH] The gene_archive table holds depricated genes. The fields translation_stable_id, translation_version, peptide_archive_id ought to be NULL for genes that lack a translation. This patch fixes these fields to allow for NULLs. --- sql/patch_54_55_h.sql | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sql/patch_54_55_h.sql diff --git a/sql/patch_54_55_h.sql b/sql/patch_54_55_h.sql new file mode 100644 index 0000000000..92f0808f8e --- /dev/null +++ b/sql/patch_54_55_h.sql @@ -0,0 +1,25 @@ +# patch_54_55_h.sql +# +# title: Change translation-related fields in gene_archive to allow for NULLs. +# +# description: +# The gene_archive table holds depricated genes. The fields +# translation_stable_id, translation_version, peptide_archive_id ought +# to be NULL for genes that lack a translation. This patch fixes these +# fields to allow for NULLs. + +ALTER TABLE gene_archive + MODIFY COLUMN translation_stable_id VARCHAR(128), + MODIFY COLUMN translation_version SMALLINT, + MODIFY COLUMN peptide_archive_id INT(10) UNSIGNED; + +-- Also fixup existing data +UPDATE gene_archive + SET translation_stable_id = NULL, + translation_version = NULL, + peptide_archive_id = NULL + WHERE translation_stable_id = ''; + +# patch identifier +INSERT INTO meta (species_id, meta_key, meta_value) +VALUES (NULL, 'patch', 'patch_54_55_h.sql|gene_archive.allow_for_NULLs'); -- GitLab