You are here

function image_attach_schema in Image 6

Implementation of hook_schema().

File

contrib/image_attach/image_attach.install, line 6

Code

function image_attach_schema() {
  $schema['image_attach'] = array(
    'description' => 'Stores the image/node relationship.',
    'fields' => array(
      'nid' => array(
        'description' => 'The {node}.nid of the node.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'iid' => array(
        'description' => 'The {image}.nid of the image file.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'weight' => array(
        'description' => 'The display order of attached images.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'nid',
      'iid',
    ),
    'indexes' => array(
      'iid' => array(
        'iid',
      ),
    ),
  );
  return $schema;
}