You are here

function dfp_schema in Doubleclick for Publishers (DFP) 7.2

Same name and namespace in other branches
  1. 7 dfp.install \dfp_schema()

Implements hook_schema().

File

./dfp.install, line 22
Installation file for DFP module.

Code

function dfp_schema() {
  $schema['dfp_tags'] = array(
    'description' => 'Stores information about DFP ad tags.',
    'export' => array(
      'key' => 'machinename',
      'primary key' => 'adid',
      'identifier' => 'tag',
      // Exports will be available as $tag
      'default hook' => 'default_dfp_tag',
      // Function hook name.
      'api' => array(
        'owner' => 'dfp',
        'api' => 'default_dfp_tags',
        // Base name for api include files.
        'minimum_version' => 1,
        'current_version' => 1,
      ),
      'load callback' => 'dfp_tag_load',
    ),
    'fields' => array(
      'adid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
        'no export' => TRUE,
      ),
      'machinename' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => "The tag's unique name.",
      ),
      'slot' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => "The ad slot's name.",
      ),
      'adunit' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'default' => '',
        'description' => "The ad unit name.",
      ),
      'size' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => "The tag's size(s).",
      ),
      'block' => array(
        'type' => 'int',
        'default' => 1,
        'description' => 'If true, a block will be created in which to display this ad tag.',
      ),
      'settings' => array(
        'type' => 'blob',
        'description' => "Serialized array of settings.",
        'size' => 'big',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'adid',
    ),
    'unique keys' => array(
      'machinename' => array(
        'machinename',
      ),
    ),
  );
  return $schema;
}