From dda4450a9a2dcc50f6bc345abaf62ed0f81f2e86 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Wed, 18 Oct 2017 15:42:35 -0400 Subject: [PATCH] fixing the not null attr for the uid in the fields table fields table uid need to be not null --- index.php | 2 +- ...se_V0.0.5.sql => create_database_V0.0.6.sql} | 2 +- setup/databaseScripts/dbVersions.php | 1 + .../databaseScripts/update_database_V0.0.6.sql | 17 +++++++++++++++++ 4 files changed, 20 insertions(+), 2 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/index.php b/index.php index b6da06a..a83dedf 100644 --- a/index.php +++ b/index.php @@ -38,7 +38,7 @@ * version from this plugin. */ define('GLM_MEMBERS_FIELDS_PLUGIN_VERSION', '1.0.3'); -define('GLM_MEMBERS_FIELDS_PLUGIN_DB_VERSION', '0.0.5'); +define('GLM_MEMBERS_FIELDS_PLUGIN_DB_VERSION', '0.0.6'); // This is the minimum version of the GLM Members DB plugin require for this plugin. define('GLM_MEMBERS_FIELDS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.8.0'); 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 976ec62..af8452b 100644 --- a/setup/databaseScripts/create_database_V0.0.5.sql +++ b/setup/databaseScripts/create_database_V0.0.6.sql @@ -21,7 +21,7 @@ CREATE TABLE {prefix}custom_fields ( admin_search BOOLEAN NOT NULL DEFAULT '0', -- If the field is added to member list filters. required BOOLEAN NOT NULL DEFAULT '0', -- If the field is required. uid INT NOT NULL, -- id for the series of custom fields associated with an entity - entity_id INT NOT NULL, -- id for the specific field associated with an entity + entity_id INT NULL, -- id for the specific field associated with an entity PRIMARY KEY (id), INDEX(field_name(20)) ); diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index e69523e..297ac95 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -19,5 +19,6 @@ $glmMembersFieldsDbVersions = array( '0.0.3' => array('version' => '0.0.3', 'tables' => 2, 'date' => '04/24/2017'), '0.0.4' => array('version' => '0.0.4', 'tables' => 2, 'date' => '10/18/2017'), '0.0.5' => array('version' => '0.0.5', 'tables' => 2, 'date' => '10/18/2017'), + '0.0.6' => array('version' => '0.0.6', 'tables' => 2, 'date' => '10/18/2017'), ); 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..36b0adf --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.6.sql @@ -0,0 +1,17 @@ +-- Gaslit Media Members Database +-- File Created: 2017-04-14 +-- 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 dashes + +ALTER TABLE {prefix}custom_fields ADD COLUMN uid INT NOT NULL; + +---- + +ALTER TABLE {prefix}custom_field_data ADD COLUMN entity_id INT NOT NULL; + +---- + +ALTER TABLE {prefix}custom_fields ADD COLUMN entity_id INT NULL; \ No newline at end of file -- 2.17.1