From 7587c1b612b55a5c22a6e95955a545d7e2da4763 Mon Sep 17 00:00:00 2001
From: Lyle Mantooth <lyle@ubercart.org>
Date: Mon, 2 May 2011 09:05:52 -0400
Subject: [PATCH] Wait for Entity to be enabled before doing updates.

---
 rules.install |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/rules.install b/rules.install
index b3aa1dd..163cf50 100644
--- a/rules.install
+++ b/rules.install
@@ -108,6 +108,10 @@ function rules_schema() {
  * Upgrade from Rules 6.x-1.x to 7.x.
  */
 function rules_update_7200() {
+  if (!module_exists('entity')) {
+    throw new DrupalUpdateException("Rules depends on the Entity module. Please enable it to run Rules' database updates.");
+  }
+
   // Create the new db tables first.
   $schema['rules_config'] = array(
     'fields' => array(
-- 
1.7.1

