From 055af5b8229331477606205f781803a9b8d48079 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 17 Aug 2022 11:54:21 +0200 Subject: [PATCH] Move WWFF info from COL_SIG_INFO to new column --- application/migrations/096_add_wwff_columns.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/application/migrations/096_add_wwff_columns.php b/application/migrations/096_add_wwff_columns.php index bd1b8961..d80d0be5 100644 --- a/application/migrations/096_add_wwff_columns.php +++ b/application/migrations/096_add_wwff_columns.php @@ -5,7 +5,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); /** * Class Migration_add_wwff_columns * - * Add wWFF columnds to database + * Add WWFF columnds to database to reflect latest ADIF v3.1.3 spec changes + * See http://www.adif.org.uk/313/ADIF_313_annotated.htm * */ @@ -18,6 +19,14 @@ class Migration_add_wwff_columns extends CI_Migration { 'COL_WWFF_REF VARCHAR(30) DEFAULT NULL', ); $this->dbforge->add_column('TABLE_HRD_CONTACTS_V01', $fields, 'COL_VUCC_GRIDS'); + + // Now copy over data from SIG_INFO fields and remove COL_SIG and COL_SIG_INFO only if COL_SIG is WWFF + // This cannot be reverted on downgrade to prevent overwriting of other COL_SIG information + $this->db->set('COL_WWFF_REF', 'COL_SIG_INFO', FALSE); + $this->db->set('COL_SIG_INFO', ''); + $this->db->set('COL_SIG', ''); + $this->db->where('COL_SIG', 'WWFF'); + $this->db->update('TABLE_HRD_CONTACTS_V01'); } }