You are here

function ad_schema in Advertisement 7.3

Same name and namespace in other branches
  1. 6.3 ad.install \ad_schema()
  2. 6 ad.install \ad_schema()
  3. 6.2 ad.install \ad_schema()
  4. 7 ad.install \ad_schema()
  5. 7.2 ad.install \ad_schema()

Implements hook_schema().

File

./ad.install, line 11
Installation file for the ad module.

Code

function ad_schema() {
  $schema['ad_node'] = array(
    'description' => 'Stores extra node ad properties.',
    'fields' => array(
      'nid' => array(
        'description' => 'Reference to the node table.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'total_clicks' => array(
        'description' => 'Total clicks of an ad.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'total_impressions' => array(
        'description' => 'Total impressions of an ad.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'nid',
    ),
  );
  return $schema;
}