From 0222fa7003a2a07fceacd2323b709d3af55deccd Mon Sep 17 00:00:00 2001
From: Angie Byron <webchick@24967.no-reply.drupal.org>
Date: Sun, 21 Nov 2010 09:24:41 +0000
Subject: [PATCH] #970002 by EclipseGc: Fixed file field foreign key table is
 incorrect

---
 modules/file/file.install   | 4 ++--
 modules/image/image.install | 8 +++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/modules/file/file.install b/modules/file/file.install
index f313249e2cd7..c697f87af704 100644
--- a/modules/file/file.install
+++ b/modules/file/file.install
@@ -13,7 +13,7 @@ function file_field_schema($field) {
   return array(
     'columns' => array(
       'fid' => array(
-        'description' => 'The {files}.fid being referenced in this field.',
+        'description' => 'The {file_managed}.fid being referenced in this field.',
         'type' => 'int',
         'not null' => FALSE,
         'unsigned' => TRUE,
@@ -37,7 +37,7 @@ function file_field_schema($field) {
     ),
     'foreign keys' => array(
       'fid' => array(
-        'table' => 'file',
+        'table' => 'file_managed',
         'columns' => array('fid' => 'fid'),
       ),
     ),
diff --git a/modules/image/image.install b/modules/image/image.install
index 3ebf6eef5838..ea3eee5ac64d 100644
--- a/modules/image/image.install
+++ b/modules/image/image.install
@@ -114,7 +114,7 @@ function image_field_schema($field) {
   return array(
     'columns' => array(
       'fid' => array(
-        'description' => 'The {files}.fid being referenced in this field.',
+        'description' => 'The {file_managed}.fid being referenced in this field.',
         'type' => 'int',
         'not null' => FALSE,
         'unsigned' => TRUE,
@@ -135,6 +135,12 @@ function image_field_schema($field) {
     'indexes' => array(
       'fid' => array('fid'),
     ),
+    'foreign keys' => array(
+      'fid' => array(
+        'table' => 'file_managed',
+        'columns' => array('fid' => 'fid'),
+      ),
+    ),
   );
 }
 
-- 
GitLab