You are here

function exif_custom_schema in EXIF Custom 7

Implements hook_schema().

File

./exif_custom.install, line 11
Schema and update hook implementations for the EXIF Custom module.

Code

function exif_custom_schema() {
  $schema['exif_custom_maps'] = array(
    'description' => 'Stores a list of custom field maps for exif_custom module.',
    'fields' => array(
      'mid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'Mapping identifier',
      ),
      'name' => array(
        'type' => 'text',
        'size' => 'normal',
        'not null' => TRUE,
        'desciption' => 'The name of the mapping.',
      ),
    ),
    'primary key' => array(
      'mid',
    ),
  );
  $schema['exif_custom_mapped_fields'] = array(
    'description' => 'Stores mappings of field for exif_custom module.',
    'fields' => array(
      'mid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'The ID of the mapping being saved.',
      ),
      'exif_field' => array(
        'type' => 'varchar',
        'size' => 'normal',
        'length' => '128',
        'default' => '',
        'not null' => TRUE,
        'desciption' => 'The EXIF field to save the mapping of.',
      ),
      'exif_example' => array(
        'type' => 'text',
        'size' => 'normal',
        'not null' => TRUE,
        'desciption' => 'The EXIF field to save the mapping of.',
      ),
      'img_field' => array(
        'type' => 'text',
        'size' => 'normal',
        'not null' => TRUE,
        'desciption' => 'The image field to map to.',
      ),
    ),
    'primary key' => array(
      'mid',
      'exif_field',
    ),
  );
  $schema['exif_custom_users'] = array(
    'description' => 'Stores indivdual user\'s default mapping',
    'fields' => array(
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => "User's uid.",
      ),
      'mid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'Default mid of user.',
      ),
    ),
    'primary key' => array(
      'uid',
    ),
  );
  return $schema;
}