From 76b965088ead798b1b393bf085519d07e758392a Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 26 Jul 2018 14:53:29 -0400 Subject: [PATCH] More db updates for contact table. Adding mailing address type and mailto label. --- classes/data/dataContacts.php | 14 ++++++++++++++ index.php | 2 +- ...abase_V0.0.5.sql => create_database_V0.0.6.sql} | 4 +++- setup/databaseScripts/dbVersions.php | 1 + setup/databaseScripts/update_database_V0.0.5.sql | 2 +- setup/databaseScripts/update_database_V0.0.6.sql | 13 +++++++++++++ 6 files changed, 33 insertions(+), 3 deletions(-) rename setup/databaseScripts/{create_database_V0.0.5.sql => create_database_V0.0.6.sql} (96%) create mode 100644 setup/databaseScripts/update_database_V0.0.6.sql diff --git a/classes/data/dataContacts.php b/classes/data/dataContacts.php index b69975e..77ed806 100644 --- a/classes/data/dataContacts.php +++ b/classes/data/dataContacts.php @@ -560,6 +560,20 @@ class GlmDataContacts extends GlmDataAbstract 'use' => 'a' ), + // Mailing Address Type + 'mailing_address_type' => array( + 'field' => 'mailing_address_type', + 'type' => 'phone', + 'use' => 'a' + ), + + // Mail To Label + 'mailto_label' => array( + 'field' => 'mailto_label', + 'type' => 'phone', + 'use' => 'a' + ), + ); } diff --git a/index.php b/index.php index acdad9e..8d0a000 100644 --- a/index.php +++ b/index.php @@ -40,7 +40,7 @@ if (!defined('ABSPATH')) { * version nunmber of that release for the DB version. */ define('GLM_MEMBERS_CONTACTS_PLUGIN_VERSION', '1.1.10'); -define('GLM_MEMBERS_CONTACTS_PLUGIN_DB_VERSION', '0.0.5'); +define('GLM_MEMBERS_CONTACTS_PLUGIN_DB_VERSION', '0.0.6'); // This is the minimum version of the GLM Members DB plugin require for this plugin. define('GLM_MEMBERS_CONTACTS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '1.0.58'); diff --git a/setup/databaseScripts/create_database_V0.0.5.sql b/setup/databaseScripts/create_database_V0.0.6.sql similarity index 96% rename from setup/databaseScripts/create_database_V0.0.5.sql rename to setup/databaseScripts/create_database_V0.0.6.sql index 1a6175b..779e0d9 100644 --- a/setup/databaseScripts/create_database_V0.0.5.sql +++ b/setup/databaseScripts/create_database_V0.0.6.sql @@ -1,6 +1,6 @@ -- Gaslight Media Members Database -- File Created: 12/09/14 15:27:15 --- Database Version: 0.0.4 +-- Database Version: 0.0.6 -- Database Creation Script - Contacts Add-On -- -- To permit each query below to be executed separately, @@ -61,6 +61,8 @@ CREATE TABLE {prefix}contacts ( contact_use_billing BOOLEAN NULL, -- Flag to use Contact Info as Billing business_publish BOOLEAN NULL, -- Flag to publish Business to Directory business_use_billing BOOLEAN NULL, -- Flag to use Business as Billing + mailing_address_type TINYTEXT NULL, -- Mailing Address Type + mailto_label TINYTEXT NULL, -- Mail To Label PRIMARY KEY (id), INDEX(fname(20)), INDEX(lname(20)), diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index 83046be..a52309e 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -32,6 +32,7 @@ $glmMembersContactsDbVersions = array( '0.0.3' => array('version' => '0.0.3', 'tables' => 1, 'date' => '1/11/2017'), '0.0.4' => array('version' => '0.0.4', 'tables' => 1, 'date' => '07/26/2018'), '0.0.5' => array('version' => '0.0.5', 'tables' => 1, 'date' => '07/26/2018'), + '0.0.6' => array('version' => '0.0.6', 'tables' => 1, 'date' => '07/26/2018'), ); diff --git a/setup/databaseScripts/update_database_V0.0.5.sql b/setup/databaseScripts/update_database_V0.0.5.sql index 8ab4cfa..2ac9024 100644 --- a/setup/databaseScripts/update_database_V0.0.5.sql +++ b/setup/databaseScripts/update_database_V0.0.5.sql @@ -1,6 +1,6 @@ -- Gaslight Media Members Database - Contacts Add-On -- File Created: 2018-07-26 --- Database Version: 0.0.4 +-- Database Version: 0.0.5 -- Database Update From Previous Version Script -- -- To permit each query below to be executed separately, diff --git a/setup/databaseScripts/update_database_V0.0.6.sql b/setup/databaseScripts/update_database_V0.0.6.sql new file mode 100644 index 0000000..c911c63 --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.6.sql @@ -0,0 +1,13 @@ +-- Gaslight Media Members Database - Contacts Add-On +-- File Created: 2018-07-26 +-- Database Version: 0.0.6 +-- Database Update From Previous Version Script +-- +-- To permit each query below to be executed separately, +-- all queries must be separated by a line with four dashses + +ALTER TABLE {prefix}contacts ADD COLUMN mailing_address_type TINYTEXT NULL; -- Mailing Address Type + +---- + +ALTER TABLE {prefix}contacts ADD COLUMN mailto_label TINYTEXT NULL; -- Mail To Label -- 2.17.1