updating database for status values for pending
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 21 Nov 2017 15:57:19 +0000 (10:57 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 21 Nov 2017 15:57:19 +0000 (10:57 -0500)
adding pending and approved values in the config array and updating the database

classes/data/dataForSale.php
config/plugin.ini
index.php
setup/databaseScripts/create_database_V0.0.1.sql [deleted file]
setup/databaseScripts/create_database_V0.0.2.sql [new file with mode: 0644]
setup/databaseScripts/dbVersions.php
setup/databaseScripts/update_database_V0.0.2.sql [new file with mode: 0644]

index ab5b1ac..ff679c1 100644 (file)
@@ -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',
index f543a57..afe05ea 100644 (file)
@@ -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
index f64144f..a3b8b11 100644 (file)
--- 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 (file)
index 0707a52..0000000
+++ /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 (file)
index 0000000..77adc14
--- /dev/null
@@ -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
index 373e2ef..92bf5c1 100644 (file)
@@ -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 (file)
index 0000000..b8d6da7
--- /dev/null
@@ -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