From 278e1f3bce62afeafe9d4ca0261e1da44350526e Mon Sep 17 00:00:00 2001
From: dooug <dooug@417693.no-reply.drupal.org>
Date: Thu, 26 Mar 2015 11:36:27 -0400
Subject: [PATCH] Issue #2183267 by jacobbednarz, dooug: Updates fail if the
 file_metadata table already exists

---
 file_entity.install | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/file_entity.install b/file_entity.install
index feeb2e2..44e1203 100644
--- a/file_entity.install
+++ b/file_entity.install
@@ -957,7 +957,11 @@ function file_entity_update_7211() {
       ),
     ),
   );
-  db_create_table('file_metadata', $schema);
+  if (!db_table_exists('file_metadata')) {
+    db_create_table('file_metadata', $schema);
+  } else {
+    throw new DrupalUpdateException(t('The file_entity module tried to create the @table table, but it already existed. Your installation might be broken.', array('@table' => 'file_metadata')));
+  }
 }
 
 /**
-- 
1.8.5.2 (Apple Git-48)

