Code coverage for /20080809/modules/upload/upload.install

Line #Times calledCode
1
<?php
2
// $Id: upload.install,v 1.7 2008/02/10 19:09:58 dries Exp $
3
4
/**
5
 * Implementation of hook_install().
6
 */
73
function upload_install() {
8
  // Create table. The upload table might have been created in the Drupal
5
9
  // to Drupal 6 upgrade, and was migrated from the file_revisions table.
So
10
  // in this case, there is no need to create the table, it is already
there.
111
  if (!db_table_exists('upload')) {
121
    drupal_install_schema('upload');
131
  }
141
}
15
16
/**
17
 * Implementation of hook_uninstall().
18
 */
193
function upload_uninstall() {
20
  // Remove tables.
210
  drupal_uninstall_schema('upload');
220
}
23
24
/**
25
 * Implementation of hook_schema().
26
 */
273
function upload_schema() {
283
  $schema['upload'] = array(
293
    'description' => t('Stores uploaded file information and table
associations.'),
30
    'fields' => array(
31
      'fid' => array(
323
        'type' => 'int',
333
        'unsigned' => TRUE,
343
        'not null' => TRUE,
353
        'default' => 0,
363
        'description' => t('Primary Key: The {files}.fid.'),
373
      ),
38
      'nid' => array(
393
        'type' => 'int',
403
        'unsigned' => TRUE,
413
        'not null' => TRUE,
423
        'default' => 0,
433
        'description' => t('The {node}.nid associated with the uploaded
file.'),
443
      ),
45
      'vid' => array(
463
        'type' => 'int',
473
        'unsigned' => TRUE,
483
        'not null' => TRUE,
493
        'default' => 0,
503
        'description' => t('Primary Key: The {node}.vid associated with the
uploaded file.'),
513
      ),
52
      'description' => array(
533
        'type' => 'varchar',
543
        'length' => 255,
553
        'not null' => TRUE,
563
        'default' => '',
573
        'description' => t('Description of the uploaded file.'),
583
      ),
59
      'list' => array(
603
        'type' => 'int',
613
        'unsigned' => TRUE,
623
        'not null' => TRUE,
633
        'default' => 0,
643
        'size' => 'tiny',
653
        'description' => t('Whether the file should be visibly listed on
the node: yes(1) or no(0).'),
663
      ),
67
      'weight' => array(
683
        'type' => 'int',
693
        'not null' => TRUE,
703
        'default' => 0,
713
        'size' => 'tiny',
723
        'description' => t('Weight of this upload in relation to other
uploads in this node.'),
733
      ),
743
    ),
753
    'primary key' => array('vid', 'fid'),
76
    'indexes' => array(
773
      'fid' => array('fid'),
783
      'nid' => array('nid'),
793
    ),
80
  );
81
823
  return $schema;
830
}
84
85
863