From: Anthony Talarico Date: Tue, 21 Nov 2017 15:57:19 +0000 (-0500) Subject: updating database for status values for pending X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=f9ba2ed01e308e09587c11e6d381836259a90d2f;p=WP-Plugins%2Fglm-member-db-for-sale.git updating database for status values for pending adding pending and approved values in the config array and updating the database --- diff --git a/classes/data/dataForSale.php b/classes/data/dataForSale.php index ab5b1ac..ff679c1 100644 --- a/classes/data/dataForSale.php +++ b/classes/data/dataForSale.php @@ -149,6 +149,14 @@ class GlmDataForSale extends GlmDataAbstract 'force_list' => true, 'use' => 'a' ), + 'status' => array ( + 'field' => 'status', + 'type' => 'list', + 'list' => $this->config['status'], + 'default' => 'Pending', + 'force_list' => true, + 'use' => 'a' + ), 'title' => array ( 'field' => 'title', 'type' => 'text', diff --git a/config/plugin.ini b/config/plugin.ini index f543a57..afe05ea 100644 --- a/config/plugin.ini +++ b/config/plugin.ini @@ -11,4 +11,7 @@ item_expiration[90] = '90 Days' item_expiration[120] = '120 Days' topics[1] = 'For Sale' -topics[2] = 'Buy' \ No newline at end of file +topics[2] = 'Buy' + +status[10] = 'Pending' +status[20] = 'Approved' \ No newline at end of file diff --git a/index.php b/index.php index f64144f..a3b8b11 100644 --- a/index.php +++ b/index.php @@ -38,7 +38,7 @@ * version from this plugin. */ define('GLM_MEMBERS_FOR_SALE_PLUGIN_VERSION', '0.0.1'); -define('GLM_MEMBERS_FOR_SALE_PLUGIN_DB_VERSION', '0.0.1'); +define('GLM_MEMBERS_FOR_SALE_PLUGIN_DB_VERSION', '0.0.2'); // This is the minimum version of the GLM Members DB plugin require for this plugin. define('GLM_MEMBERS_FOR_SALE_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.8.0'); diff --git a/setup/databaseScripts/create_database_V0.0.1.sql b/setup/databaseScripts/create_database_V0.0.1.sql deleted file mode 100644 index 0707a52..0000000 --- a/setup/databaseScripts/create_database_V0.0.1.sql +++ /dev/null @@ -1,48 +0,0 @@ --- Gaslight Media Members Database - For Sale --- File Created: 12/02/15 15:27:15 --- Database Version: 0.0.1 --- Database Creation Script --- --- This file is called to create a new set of tables for this --- add-on for the most receint database version for this add-on. --- --- There should only be one such file in this directory --- --- To permit each query below to be executed separately, --- all queries must be separated by a line with four dashes - --- Conditions Table -CREATE TABLE {prefix}items ( - id INT NOT NULL AUTO_INCREMENT, - old_id int NULL , - topic int NULL , - title TEXT NULL , - company TINYTEXT NULL , - location TEXT NULL , - descr TEXT NULL , - contact_email TINYTEXT NULL , - contact_name TINYTEXT NULL , - contact_phone TINYTEXT NULL , - post_date DATETIME NULL, - updated DATETIME NULL, - visible BOOL NULL, - terms TEXT NULL, - item_expiration INT NULL, - image_1 TINYTEXT NULL , - image_2 TINYTEXT NULL , - image_3 TINYTEXT NULL , - member INT NULL, - repost BOOL null, - PRIMARY KEY (id) -); - ----- - --- default entries in table --- INSERT INTO {prefix}items ( --- id,old_id,title,descr,topic,contact_email,contact_name,contact_phone,post_date,visible, --- terms,location,item_expiration,image_3,image_1, --- company,member,image_2 --- ) VALUES ( 1, 1,"TITLE", "DESCR", 1, "CONTACT_EMAIL", "CONTACT_NAME", "CONTACT_PHONE", NOW(), true, "TERMS", "LOCATION", 60, "IMAGE_3.jpg", --- "IMAGE_1.jpg", "COMPANY", 1, "IMAGE_2.jpg" --- ); \ No newline at end of file diff --git a/setup/databaseScripts/create_database_V0.0.2.sql b/setup/databaseScripts/create_database_V0.0.2.sql new file mode 100644 index 0000000..77adc14 --- /dev/null +++ b/setup/databaseScripts/create_database_V0.0.2.sql @@ -0,0 +1,49 @@ +-- Gaslight Media Members Database - For Sale +-- File Created: 12/02/15 15:27:15 +-- Database Version: 0.0.2 +-- Database Creation Script +-- +-- This file is called to create a new set of tables for this +-- add-on for the most receint database version for this add-on. +-- +-- There should only be one such file in this directory +-- +-- To permit each query below to be executed separately, +-- all queries must be separated by a line with four dashes + +-- Conditions Table +CREATE TABLE {prefix}items ( + id INT NOT NULL AUTO_INCREMENT, + old_id int NULL , + topic int NULL , + title TEXT NULL , + company TINYTEXT NULL , + location TEXT NULL , + descr TEXT NULL , + contact_email TINYTEXT NULL , + contact_name TINYTEXT NULL , + contact_phone TINYTEXT NULL , + post_date DATETIME NULL, + updated DATETIME NULL, + visible BOOL NULL, + terms TEXT NULL, + item_expiration INT NULL, + image_1 TINYTEXT NULL , + image_2 TINYTEXT NULL , + image_3 TINYTEXT NULL , + member INT NULL, + repost BOOL null, + status TINYINT null, + PRIMARY KEY (id) +); + +---- + +-- default entries in table +-- INSERT INTO {prefix}items ( +-- id,old_id,title,descr,topic,contact_email,contact_name,contact_phone,post_date,visible, +-- terms,location,item_expiration,image_3,image_1, +-- company,member,image_2 +-- ) VALUES ( 1, 1,"TITLE", "DESCR", 1, "CONTACT_EMAIL", "CONTACT_NAME", "CONTACT_PHONE", NOW(), true, "TERMS", "LOCATION", 60, "IMAGE_3.jpg", +-- "IMAGE_1.jpg", "COMPANY", 1, "IMAGE_2.jpg" +-- ); \ No newline at end of file diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index 373e2ef..92bf5c1 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -35,4 +35,5 @@ $glmMembersForSaleDbVersions = array( '0.0.1' => array('version' => '0.0.1', 'tables' => 1, 'date' => '09/15/2017'), + '0.0.2' => array('version' => '0.0.2', 'tables' => 1, 'date' => '11/15/2017'), ); diff --git a/setup/databaseScripts/update_database_V0.0.2.sql b/setup/databaseScripts/update_database_V0.0.2.sql new file mode 100644 index 0000000..b8d6da7 --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.2.sql @@ -0,0 +1,11 @@ +-- Gaslight Media Members Database - For Sale Add-On +-- File Created: 11/09/17 15:27:15 +-- Database Version: 0.0.2 +-- 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 Status +ALTER TABLE {prefix}items ADD COLUMN status TINYINT; \ No newline at end of file