function media_flickr_schema in Media: Flickr 6
Implementation of hook_schema().
File
- ./
media_flickr.install, line 264 - Installation file for Media: Flickr.
Code
function media_flickr_schema() {
$schema['media_flickr'] = array(
'description' => t('Stores data for individual flickr images.'),
'fields' => array(
'code' => array(
'default' => '',
'description' => t('The flickr photo code.'),
'length' => 255,
'not null' => TRUE,
'type' => 'varchar',
),
'title' => array(
'default' => '',
'description' => t('The flickr title.'),
'length' => 255,
'not null' => TRUE,
'type' => 'varchar',
),
'owner' => array(
'default' => '',
'description' => t('The flickr photo owner.'),
'length' => 255,
'not null' => TRUE,
'type' => 'varchar',
),
'description' => array(
'description' => t('The flickr photo description.'),
'type' => 'text',
'not null' => TRUE,
'size' => 'big',
),
'url' => array(
'default' => '',
'description' => t('The URL to the original flickr photo page.'),
'length' => 255,
'not null' => TRUE,
'type' => 'varchar',
),
),
'primary key' => array(
'code',
),
);
$schema['media_flickr_sizes'] = array(
'description' => t('Stores file information and data for individual flickr images, possibly including a local file.'),
'fields' => array(
'code' => array(
'default' => '',
'description' => t('The flickr photo code.'),
'length' => 255,
'not null' => TRUE,
'type' => 'varchar',
),
'size' => array(
'description' => t("The size of this image, from 0-5, corresponding to Flickr's sizes."),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'fid' => array(
'description' => t("The {file}.fid of this photo's local file, if set."),
'not null' => TRUE,
'type' => 'int',
'unsigned' => TRUE,
),
),
'indexes' => array(
'code' => array(
'code',
),
'fid' => array(
'fid',
),
'size' => array(
'size',
),
),
);
$schema['media_flickr_sets'] = array(
'description' => t('Stores photos for flickr photosets.'),
'fields' => array(
'photoset' => array(
'default' => '',
'description' => t('The flickr photoset code.'),
'length' => 255,
'not null' => TRUE,
'type' => 'varchar',
),
'code' => array(
'default' => '',
'description' => t('The flickr photo code.'),
'length' => 255,
'not null' => TRUE,
'type' => 'varchar',
),
),
'indexes' => array(
'photoset' => array(
'photoset',
),
'code' => array(
'code',
),
),
);
$schema['media_flickr_node'] = array(
'description' => t('Node/field references for flickr photosets.'),
'fields' => array(
'nid' => array(
'description' => t("The {node}.nid for this photoset."),
'not null' => TRUE,
'type' => 'int',
'unsigned' => TRUE,
),
'field' => array(
'default' => '',
'description' => t('The fieldname this photoset is stored in.'),
'length' => 255,
'not null' => TRUE,
'type' => 'varchar',
),
'delta' => array(
'description' => t("The field delta for this photoset."),
'not null' => TRUE,
'type' => 'int',
'default' => 0,
),
'photoset' => array(
'default' => '',
'description' => t('The flickr photoset code.'),
'length' => 255,
'not null' => TRUE,
'type' => 'varchar',
),
),
'indexes' => array(
'nid' => array(
'nid',
),
'field' => array(
'field',
),
'photoset' => array(
'photoset',
),
),
);
$schema['media_flickr_photoset_count'] = array(
'description' => t('Node instance counts for flickr photosets.'),
'fields' => array(
'photoset' => array(
'default' => '',
'description' => t('The flickr photoset code.'),
'length' => 255,
'not null' => TRUE,
'type' => 'varchar',
),
'instances' => array(
'description' => t("The number of items this photoset appears in."),
'not null' => TRUE,
'type' => 'int',
'unsigned' => TRUE,
),
),
'primary key' => array(
'photoset',
),
);
return $schema;
}