Adding new field for the member_type
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 19 Mar 2018 15:40:16 +0000 (11:40 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 19 Mar 2018 15:40:16 +0000 (11:40 -0400)
Add new field to the invoice_type table.
Member Type
Will be used for creating new invoices based on member type.

index.php
setup/databaseScripts/create_database_V0.0.13.sql
setup/databaseScripts/dbVersions.php
setup/databaseScripts/update_database_V0.0.14.sql [new file with mode: 0644]

index 932b64b..ffd241b 100644 (file)
--- a/index.php
+++ b/index.php
@@ -38,7 +38,7 @@
  *  version from this plugin.
  */
 define('GLM_MEMBERS_BILLING_PLUGIN_VERSION', '0.0.1');
-define('GLM_MEMBERS_BILLING_PLUGIN_DB_VERSION', '0.0.13');
+define('GLM_MEMBERS_BILLING_PLUGIN_DB_VERSION', '0.0.14');
 
 // This is the minimum version of the GLM Members DB plugin require for this plugin.
 define('GLM_MEMBERS_BILLING_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.8.0');
index 70ef9e0..0a9b126 100644 (file)
@@ -76,6 +76,7 @@ CREATE TABLE {prefix}invoice_types (
     id INT NOT NULL AUTO_INCREMENT,
     name TINYTEXT NOT NULL,                                -- name
     parent INT NOT NULL DEFAULT 0,                         -- 0 if top level otherwise ref to another line_item_type as it's parent
+    member_type INT NOT NULL DEFAULT 0,                    -- Member Type assigned Default 0
     amount DECIMAL(8,2) NOT NULL DEFAULT '0.00',           -- amount
     recurring BOOLEAN DEFAULT '0',                         -- true/false if recurring
     recurrence INT NULL DEFAULT 0,                         -- recurrence type
index c53cd54..525375a 100644 (file)
@@ -27,5 +27,6 @@ $glmMembersBillingDbVersions = array(
     '0.0.11' => array('version' => '0.0.11', 'tables' => 14),
     '0.0.12' => array('version' => '0.0.12', 'tables' => 14),
     '0.0.13' => array('version' => '0.0.13', 'tables' => 14),
+    '0.0.14' => array('version' => '0.0.14', 'tables' => 14),
 );
 
diff --git a/setup/databaseScripts/update_database_V0.0.14.sql b/setup/databaseScripts/update_database_V0.0.14.sql
new file mode 100644 (file)
index 0000000..329c979
--- /dev/null
@@ -0,0 +1,9 @@
+-- Gaslight Media Billing Database
+-- File Created: 03/19/2018
+-- Database Version: 0.0.14
+--
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashes
+
+-- Add member_type to invoice_type table
+ALTER TABLE {prefix}invoice_types ADD member_type INT NOT NULL DEFAULT 0;   -- Member Type assigned Default 0