From 14640561875d908db387a5becdfb14039a725ba5 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 5 Apr 2018 13:11:01 -0400 Subject: [PATCH] Update for database. Add account column for line items table. --- index.php | 2 +- ..._database_V0.0.17.sql => create_database_V0.0.18.sql} | 1 + setup/databaseScripts/dbVersions.php | 1 + setup/databaseScripts/update_database_V0.0.18.sql | 9 +++++++++ 4 files changed, 12 insertions(+), 1 deletion(-) rename setup/databaseScripts/{create_database_V0.0.17.sql => create_database_V0.0.18.sql} (99%) create mode 100644 setup/databaseScripts/update_database_V0.0.18.sql diff --git a/index.php b/index.php index 6b16dd6..3cb10ea 100644 --- 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.17'); +define('GLM_MEMBERS_BILLING_PLUGIN_DB_VERSION', '0.0.18'); // 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'); diff --git a/setup/databaseScripts/create_database_V0.0.17.sql b/setup/databaseScripts/create_database_V0.0.18.sql similarity index 99% rename from setup/databaseScripts/create_database_V0.0.17.sql rename to setup/databaseScripts/create_database_V0.0.18.sql index df04f9d..15c38ee 100644 --- a/setup/databaseScripts/create_database_V0.0.17.sql +++ b/setup/databaseScripts/create_database_V0.0.18.sql @@ -91,6 +91,7 @@ CREATE TABLE {prefix}line_items ( id INT NOT NULL AUTO_INCREMENT, invoice INT NOT NULL, -- reference to invoice line_item_type INT NOT NULL, -- reference to line item type + account INT NULL DEFAULT 0, -- ref to account id (renewal or employee) name TEXT NOT NULL, -- line item name amount DECIMAL(8,2) DEFAULT '0.00', -- line item amount per item quantity INT DEFAULT 1, -- quantity diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index b9dd82e..729b630 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -31,5 +31,6 @@ $glmMembersBillingDbVersions = array( '0.0.15' => array('version' => '0.0.15', 'tables' => 14), '0.0.16' => array('version' => '0.0.16', 'tables' => 14), '0.0.17' => array('version' => '0.0.17', 'tables' => 14), + '0.0.18' => array('version' => '0.0.18', 'tables' => 14), ); diff --git a/setup/databaseScripts/update_database_V0.0.18.sql b/setup/databaseScripts/update_database_V0.0.18.sql new file mode 100644 index 0000000..6b14e3b --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.18.sql @@ -0,0 +1,9 @@ +-- Gaslight Media Billing Database +-- File Created: 04/05/2018 +-- Database Version: 0.0.18 +-- +-- To permit each query below to be executed separately, +-- all queries must be separated by a line with four dashes + +-- Update the settings +ALTER TABLE {prefix}line_items ADD account INT NULL DEFAULT '0'; -- ref to account id (renewal or employee) -- 2.17.1