From 9c1cb66b66009eb847f26ab83e7d31c26215dd12 Mon Sep 17 00:00:00 2001
From: Patrick W <pwaters@drupal-dev-pwaters.HighWire.ORG>
Date: Thu, 10 May 2012 14:04:59 -0700
Subject: [PATCH] Fixing system module bad update

---
 modules/system/system.install |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/modules/system/system.install b/modules/system/system.install
index c030000..aa74cb9 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -2997,6 +2997,14 @@ function system_update_7072() {
  * it.
  */
 function system_update_7073() {
+  // Removed this update because it was not removing indicies before changing the field definition
+}
+
+/**
+ * Need to remove indexes before applying update as per http://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_change_field/7
+ */
+function system_update_7074(){
+  db_drop_index('file_managed', 'filenamme');
   db_change_field('file_managed', 'filename', 'filename', array(
     'description' => 'Name of the file with no path components. This may differ from the basename of the URI if the file is renamed to avoid overwriting an existing file.',
     'type' => 'varchar',
@@ -3005,6 +3013,8 @@ function system_update_7073() {
     'default' => '',
     'binary' => TRUE,
   ));
+
+  db_drop_index('file_managed', 'uri');
   db_change_field('file_managed', 'uri', 'uri', array(
     'description' => 'The URI to access the file (either local or remote).',
     'type' => 'varchar',
-- 
1.7.6.4

