From 7bcca819123b0f811a52381847a1cfc7060b023c Mon Sep 17 00:00:00 2001
From: Pol Dell'Aiera <Pol@47194.no-reply.drupal.org>
Date: Wed, 9 Nov 2011 15:33:06 +0100
Subject: [PATCH] 1072860: Fix for views_update_nn() functions in views.install are out of sync

---
 views.install |   37 ++++++++++++++++++++++++++++---------
 1 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/views.install b/views.install
index df763e2..98be479 100644
--- a/views.install
+++ b/views.install
@@ -550,16 +550,16 @@ function views_schema_6013() {
 
 function views_update_6013() {
   $ret = array();
+  if (!db_field_exists('views_view', 'human_name')) {
+    $new_field = array(
+      'type' => 'varchar',
+      'length' => '255',
+      'default' => '',
+      'description' => 'A human readable name used to be displayed in the admin interface',
+    );
 
-  $new_field = array(
-    'type' => 'varchar',
-    'length' => '255',
-    'default' => '',
-    'description' => 'A human readable name used to be displayed in the admin interface',
-  );
-
-  db_add_field('views_view', 'human_name', $new_field);
-
+    db_add_field('views_view', 'human_name', $new_field);
+  }
   return $ret;
 }
 
@@ -638,3 +638,22 @@ function views_update_7001() {
   }
 
 }
+
+function views_schema_7300() {
+  return views_schema_6013();
+}
+
+/**
+ * Make sure the human_name field is added to the views_view table.
+ *
+ * If you updated from 6.x-2.x-dev to 7.x-3.x you had already schema
+ * version 6014, so the update 6013 isn't runned, and never was.
+ * As a result the human_name field is missing in the database.
+ *
+ * Add the human_name field if it doesn't exists before.
+ */
+function views_update_7300() {
+  if (!db_field_exists('views_view', 'human_name')) {
+    views_update_6013();
+  }
+}
\ No newline at end of file
-- 
1.7.3.4

