You are here

function image_schema in Image 7

Same name and namespace in other branches
  1. 6 image.install \image_schema()

Implementation of hook_schema().

File

./image.install, line 6

Code

function image_schema() {
  $schema['image'] = array(
    'description' => 'Stores image files information.',
    'fields' => array(
      'nid' => array(
        'description' => 'Primary Key: The {node}.nid of the image node.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'fid' => array(
        'description' => 'Index: The {files}.fid of the image file.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'image_size' => array(
        'description' => 'Primary Key: The {files}.filename of the image file. For image module this indicates the file size.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'nid',
      'image_size',
    ),
    'indexes' => array(
      'fid' => array(
        'fid',
      ),
    ),
  );
  return $schema;
}