You are here

function ad_image_schema in Advertisement 6.3

Same name and namespace in other branches
  1. 6 image/ad_image.install \ad_image_schema()
  2. 6.2 image/ad_image.install \ad_image_schema()
  3. 7 image/ad_image.install \ad_image_schema()

Implementation of hook_schema().

File

image/ad_image.install, line 14
Ad_image module database schema.

Code

function ad_image_schema() {
  $schema['ad_image'] = array(
    'description' => 'The ad_image table stores image information such as file ID, title, width, height of corresponding image ads.',
    'fields' => array(
      'aid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'fid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'url' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
      ),
      'tooltip' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
      ),
      'remote_image' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
      ),
      'width' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'height' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'unique keys' => array(
      'aid' => array(
        'aid',
      ),
    ),
  );
  $schema['ad_image_format'] = array(
    'description' => 'The ad_image_format table stores dimensions for image ads.',
    'fields' => array(
      'gid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'min_width' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'max_width' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'min_height' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'max_height' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'max_size' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'gid',
    ),
  );
  return $schema;
}