From 2f9e9c1499108e7e646e57606d4345ccd050e2c4 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 13 Jun 2016 14:15:20 -0400 Subject: [PATCH] Adding the new tables to plugin Tables added: wp_glm_members_amenity_groups = the group wp_glm_members_grouped_amenities = amenity to group map --- index.php | 2 +- ..._V1.1.8.sql => create_database_V1.1.9.sql} | 21 ++++++++++++++ setup/databaseScripts/dbVersions.php | 3 +- .../update_database_V1.1.9.sql | 29 +++++++++++++++++++ 4 files changed, 53 insertions(+), 2 deletions(-) rename setup/databaseScripts/{create_database_V1.1.8.sql => create_database_V1.1.9.sql} (96%) create mode 100644 setup/databaseScripts/update_database_V1.1.9.sql diff --git a/index.php b/index.php index 48274692..9ae24936 100644 --- a/index.php +++ b/index.php @@ -39,7 +39,7 @@ */ define('GLM_MEMBERS_PLUGIN_VERSION', '2.0.7'); -define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.8'); +define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.9'); // Check if plugin version is not current in WordPress option and if needed updated it if (GLM_MEMBERS_PLUGIN_VERSION != get_option('glmMembersDatabasePluginVersion')) { diff --git a/setup/databaseScripts/create_database_V1.1.8.sql b/setup/databaseScripts/create_database_V1.1.9.sql similarity index 96% rename from setup/databaseScripts/create_database_V1.1.8.sql rename to setup/databaseScripts/create_database_V1.1.9.sql index 8612b7a1..cfc7c726 100644 --- a/setup/databaseScripts/create_database_V1.1.8.sql +++ b/setup/databaseScripts/create_database_V1.1.9.sql @@ -38,6 +38,27 @@ CREATE TABLE {prefix}amenity_ref ( ---- +-- groups +CREATE TABLE {prefix}amenity_groups ( + id INT NOT NULL AUTO_INCREMENT, + name TINYTEXT NULL, -- Name of the Group + PRIMARY KEY (id), + INDEX(name(20)) +); + +---- + +-- Amenity Group - Links a specific amenity to groups +CREATE TABLE {prefix}grouped_amenities ( + id INT NOT NULL AUTO_INCREMENT, + group_id INT, -- Pointer to the group + amenity_id INT, -- Pointer to the Amenity + searchable BOOLEAN DEFAULT '0', -- Flag indicating whether the amenity group will show in the search form + PRIMARY KEY (id) +); + +---- + -- Member Cateogries - used with member information records CREATE TABLE {prefix}categories ( id INT NOT NULL AUTO_INCREMENT, diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index 8e6f5ecf..53c8b56d 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -39,7 +39,8 @@ $glmMembersDbVersions = array( '1.1.5' => array('version' => '1.1.5', 'tables' => 14, 'date' => '5/11/16'), '1.1.6' => array('version' => '1.1.6', 'tables' => 14, 'date' => '5/23/16'), '1.1.7' => array('version' => '1.1.7', 'tables' => 14, 'date' => '5/24/16'), - '1.1.8' => array('version' => '1.1.8', 'tables' => 14, 'date' => '6/01/16') + '1.1.8' => array('version' => '1.1.8', 'tables' => 14, 'date' => '6/01/16'), + '1.1.9' => array('version' => '1.1.9', 'tables' => 16, 'date' => '6/13/16'), ); diff --git a/setup/databaseScripts/update_database_V1.1.9.sql b/setup/databaseScripts/update_database_V1.1.9.sql new file mode 100644 index 00000000..03df6cc6 --- /dev/null +++ b/setup/databaseScripts/update_database_V1.1.9.sql @@ -0,0 +1,29 @@ +-- Gaslight Media Members Database +-- File Created: 11/11/16 15:27:15 +-- Database Version: 1.1.4 +-- 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 + +-- Add new tables for the Grouped Amenities + + +-- groups +CREATE TABLE {prefix}amenity_groups ( + id INT NOT NULL AUTO_INCREMENT, + name TINYTEXT NULL, -- Name of the Group + PRIMARY KEY (id), + INDEX(name(20)) +); + +---- + +-- Amenity Group - Links a specific amenity to groups +CREATE TABLE {prefix}grouped_amenities ( + id INT NOT NULL AUTO_INCREMENT, + group_id INT, -- Pointer to the group + amenity_id INT, -- Pointer to the Amenity + searchable BOOLEAN DEFAULT '0', -- Flag indicating whether the amenity group will show in the search form + PRIMARY KEY (id) +); -- 2.17.1