summaryrefslogtreecommitdiff
path: root/modules/system/system.install
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-08-27 11:59:51 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-08-27 11:59:51 +0000
commit94bf1a44a9def2571c81502d4fdaf891b2da89cd (patch)
tree000ff2533ec06a919249091d830279d9de8ac73c /modules/system/system.install
parentedd3094eae80f2ac9b8fd9bafc66430314fc3c50 (diff)
downloadbrdo-94bf1a44a9def2571c81502d4fdaf891b2da89cd.tar.gz
brdo-94bf1a44a9def2571c81502d4fdaf891b2da89cd.tar.bz2
#895032 by Sutharsan, clemens.tolboom: Fixed Upgrade fails on missing file_usage() table.
Diffstat (limited to 'modules/system/system.install')
-rw-r--r--modules/system/system.install100
1 files changed, 48 insertions, 52 deletions
diff --git a/modules/system/system.install b/modules/system/system.install
index 0b1e67385..1f204009b 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -2631,6 +2631,54 @@ function system_update_7059(&$sandbox) {
return;
}
+ // Create the {file_usage} table.
+ $spec = array(
+ 'description' => 'Track where a file is used.',
+ 'fields' => array(
+ 'fid' => array(
+ 'description' => 'File ID.',
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ ),
+ 'module' => array(
+ 'description' => 'The name of the module that is using the file.',
+ 'type' => 'varchar',
+ 'length' => 255,
+ 'not null' => TRUE,
+ 'default' => '',
+ ),
+ 'type' => array(
+ 'description' => 'The name of the object type in which the file is used.',
+ 'type' => 'varchar',
+ 'length' => 64,
+ 'not null' => TRUE,
+ 'default' => '',
+ ),
+ 'id' => array(
+ 'description' => 'The primary key of the object using the file.',
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ 'default' => 0,
+ ),
+ 'count' => array(
+ 'description' => 'The number of times this file is used by this object.',
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ 'default' => 0,
+ ),
+ ),
+ 'primary key' => array('fid', 'type', 'id', 'module'),
+ 'indexes' => array(
+ 'type_id' => array('type', 'id'),
+ 'fid_count' => array('fid', 'count'),
+ 'fid_module' => array('fid', 'module'),
+ ),
+ );
+ db_create_table('file_usage', $spec);
+
if (!isset($sandbox['progress'])) {
// Initialize batch update information.
$sandbox['progress'] = 0;
@@ -2833,58 +2881,6 @@ function system_update_7059(&$sandbox) {
}
/**
- * Create the file_usage table.
- */
-function system_update_7060() {
- $spec = array(
- 'description' => 'Track where a file is used.',
- 'fields' => array(
- 'fid' => array(
- 'description' => 'File ID.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- 'module' => array(
- 'description' => 'The name of the module that is using the file.',
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- 'default' => '',
- ),
- 'type' => array(
- 'description' => 'The name of the object type in which the file is used.',
- 'type' => 'varchar',
- 'length' => 64,
- 'not null' => TRUE,
- 'default' => '',
- ),
- 'id' => array(
- 'description' => 'The primary key of the object using the file.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'count' => array(
- 'description' => 'The number of times this file is used by this object.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- ),
- 'primary key' => array('fid', 'type', 'id', 'module'),
- 'indexes' => array(
- 'type_id' => array('type', 'id'),
- 'fid_count' => array('fid', 'count'),
- 'fid_module' => array('fid', 'module'),
- ),
- );
- db_create_table('file_usage', $spec);
-}
-
-/**
* @} End of "defgroup updates-6.x-to-7.x"
* The next series of updates should start at 8000.
*/