From 556466bd9422b44c136021401d6768bae7e62600 Mon Sep 17 00:00:00 2001
From: root <root@local.timeinc.net>
Date: Mon, 2 Jun 2014 18:16:05 -0400
Subject: [PATCH] Issue 2278711 (dirty)

---
 entity_index.module                         |   20 ++++++++++++++++++++
 entity_index_node/entity_index_node.install |    5 +++++
 2 files changed, 25 insertions(+), 0 deletions(-)
 create mode 100644 entity_index_node/entity_index_node.install

diff --git a/entity_index.module b/entity_index.module
index 689003b..28b9289 100644
--- a/entity_index.module
+++ b/entity_index.module
@@ -221,3 +221,23 @@ function entity_index_views_api() {
     'api' => 3,
   );
 }
+
+/**
+ * API call for removing entity type tables.
+ */
+function entity_index_cleanup($entity_type = '') {
+  $test = NULL;
+
+  // The schema for that entity would not be available at this point because
+  // it is already disabled.
+  #$schema = drupal_get_schema_unprocessed("entity_index_{$entity_type}");
+  #_drupal_schema_initialize($schema, $module, FALSE);
+
+  #         $schema["entity_index_{$entity_type}"] = array(
+
+  // Remove entity table if it exists.
+  $table = "entity_index_{$entity_type}";
+  if (db_table_exists($table)) {
+    db_drop_table($table);
+  }
+}
diff --git a/entity_index_node/entity_index_node.install b/entity_index_node/entity_index_node.install
new file mode 100644
index 0000000..1724dac
--- /dev/null
+++ b/entity_index_node/entity_index_node.install
@@ -0,0 +1,5 @@
+<?php
+
+function entity_index_node_uninstall() {
+  entity_index_cleanup('node');
+}
-- 
1.7.1

