rolling back previous database changes
authorAnthony Talarico <talarico@gaslightmedia.com>
Wed, 18 Oct 2017 20:09:17 +0000 (16:09 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Wed, 18 Oct 2017 20:09:17 +0000 (16:09 -0400)
fixing database update script errors, rolling back previous changes

index.php
setup/databaseScripts/create_database_V0.0.4.sql [new file with mode: 0644]
setup/databaseScripts/create_database_V0.0.6.sql [deleted file]
setup/databaseScripts/dbVersions.php
setup/databaseScripts/update_database_V0.0.4.sql
setup/databaseScripts/update_database_V0.0.5.sql [deleted file]
setup/databaseScripts/update_database_V0.0.6.sql [deleted file]

index a83dedf..5d83803 100644 (file)
--- 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.6');
+define('GLM_MEMBERS_FIELDS_PLUGIN_DB_VERSION', '0.0.4');
 
 // 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.4.sql b/setup/databaseScripts/create_database_V0.0.4.sql
new file mode 100644 (file)
index 0000000..75a0f58
--- /dev/null
@@ -0,0 +1,41 @@
+-- Gaslight Media Members Database - Fields Add-On
+-- File Created: 2017-03-27
+-- Database Version: 0.0.4
+-- Database Creation Script
+--
+-- This file is called to create a new set of tables for this
+-- add-on for the most recent 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
+
+
+-- Field Setup Table
+CREATE TABLE {prefix}custom_fields (
+  id INT NOT NULL AUTO_INCREMENT,
+  field_name TINYTEXT NOT NULL DEFAULT '',      -- Field Name
+  field_type TINYTEXT NOT NULL DEFAULT '',      -- Field Type
+  field_order SMALLINT NOT NULL DEFAULT 0,      -- Order for Field
+  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 DEFAULT '0',           -- id for the specific field associated with an entity
+  PRIMARY KEY (id),
+  INDEX(field_name(20))
+);
+
+----
+
+-- Data Table
+CREATE TABLE {prefix}custom_field_data (
+  id INT NOT NULL AUTO_INCREMENT,
+  field_id INT NOT NULL DEFAULT 0,              -- Field Id
+  ref_dest INT NOT NULL DEFAULT 0,              -- Member Info Id
+  field_data TEXT NOT NULL DEFAULT '',          -- Data for the field
+  entity_id INT NOT NULL,                       -- id for the specific field associated with an entity
+  PRIMARY KEY (id),
+  INDEX(field_id),
+  INDEX(ref_dest)
+);
diff --git a/setup/databaseScripts/create_database_V0.0.6.sql b/setup/databaseScripts/create_database_V0.0.6.sql
deleted file mode 100644 (file)
index af8452b..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
--- Gaslight Media Members Database - Fields Add-On
--- File Created: 2017-03-27
--- Database Version: 0.0.5
--- Database Creation Script
---
--- This file is called to create a new set of tables for this
--- add-on for the most recent 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
-
-
--- Field Setup Table
-CREATE TABLE {prefix}custom_fields (
-  id INT NOT NULL AUTO_INCREMENT,
-  field_name TINYTEXT NOT NULL DEFAULT '',      -- Field Name
-  field_type TINYTEXT NOT NULL DEFAULT '',      -- Field Type
-  field_order SMALLINT NOT NULL DEFAULT 0,      -- Order for Field
-  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 NULL,                           -- id for the specific field associated with an entity
-  PRIMARY KEY (id),
-  INDEX(field_name(20))
-);
-
-----
-
--- Data Table
-CREATE TABLE {prefix}custom_field_data (
-  id INT NOT NULL AUTO_INCREMENT,
-  field_id INT NOT NULL DEFAULT 0,              -- Field Id
-  ref_dest INT NOT NULL DEFAULT 0,              -- Member Info Id
-  field_data TEXT NOT NULL DEFAULT '',          -- Data for the field
-  entity_id INT NOT NULL,                       -- id for the specific field associated with an entity
-  PRIMARY KEY (id),
-  INDEX(field_id),
-  INDEX(ref_dest)
-);
index 297ac95..dc0810e 100644 (file)
@@ -18,7 +18,5 @@ $glmMembersFieldsDbVersions = array(
     '0.0.2' => array('version' => '0.0.2', 'tables' => 2, 'date' => '04/14/2017'),
     '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'),
 );
 
index c88a0eb..122845d 100644 (file)
@@ -7,3 +7,15 @@
 -- all queries must be separated by a line with four dashes
 
 ALTER TABLE {prefix}custom_fields ADD COLUMN required BOOLEAN DEFAULT '0';
+
+----
+
+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 NOT NULL DEFAULT '0';
diff --git a/setup/databaseScripts/update_database_V0.0.5.sql b/setup/databaseScripts/update_database_V0.0.5.sql
deleted file mode 100644 (file)
index 749ad8e..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
--- Gaslit Media Members Database
--- File Created: 2017-04-14
--- Database Version: 0.0.5
--- 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;
-
-----
-
-ALTER TABLE {prefix}custom_field_data ADD COLUMN entity_id INT;
-
-----
-
-ALTER TABLE {prefix}custom_field_data ADD COLUMN uid INT;
\ No newline at end of file
diff --git a/setup/databaseScripts/update_database_V0.0.6.sql b/setup/databaseScripts/update_database_V0.0.6.sql
deleted file mode 100644 (file)
index 36b0adf..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
--- 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