You are here

function ml_image_schema in Media Library 6

Implementation of hook_schema()

File

ml_image/ml_image.install, line 25
Media Library Image install procedures

Code

function ml_image_schema() {
  $schema['ml_image_metadata'] = array(
    'description' => 'Stores metadata for images',
    'fields' => array(
      'fid' => array(
        'description' => 'The file identifier, referencing {files}.fid',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'title' => array(
        'description' => 'Descriptive image title',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'copyright' => array(
        'description' => 'Copyright short information',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'author' => array(
        'description' => 'Photographer name',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'source' => array(
        'description' => 'Source of image',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'fid',
    ),
  );
  $schema['ml_image_term'] = array(
    'description' => 'Stores metadata tags for images',
    'fields' => array(
      'fid' => array(
        'description' => 'The file identifier, referencing {files}.fid',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'tid' => array(
        'description' => 'The term identifier, referencing {term_data}.tid',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'fid' => array(
        'fid',
      ),
    ),
    'primary key' => array(
      'fid',
      'tid',
    ),
  );
  return $schema;
}