You are here

function dynamic_banner_schema in Dynamic Banner 7

Same name and namespace in other branches
  1. 8 dynamic_banner.install \dynamic_banner_schema()
  2. 6 dynamic_banner.install \dynamic_banner_schema()
  3. 7.2 dynamic_banner.install \dynamic_banner_schema()
  4. 8.x dynamic_banner.install \dynamic_banner_schema()

Implements hook_schema().

Will create the database needed to store the banner connections

File

./dynamic_banner.install, line 14
The install file of dynamic_banner

Code

function dynamic_banner_schema() {
  $schema['dynamic_banner'] = array(
    'description' => 'The table for the path to banner relationship',
    'fields' => array(
      'dbid' => array(
        'description' => 'The primary key always unique',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'path' => array(
        'description' => 'The path of the page where this banner will live',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
      ),
      'imgurl' => array(
        'description' => 'The path of the image for the banner',
        'type' => 'varchar',
        'length' => '255',
        'not null' => FALSE,
        'default' => NULL,
      ),
      'imgfid' => array(
        'description' => 'If the image is managed these are the fids of the image for the banner',
        'type' => 'varchar',
        'length' => '255',
        'not null' => FALSE,
        'default' => NULL,
      ),
      'text' => array(
        'description' => 'The text to display on this relationship',
        'type' => 'varchar',
        'length' => '255',
        'not null' => FALSE,
      ),
      'link' => array(
        'description' => 'The link to make the banner point to',
        'type' => 'varchar',
        'length' => '255',
        'not null' => FALSE,
      ),
      'mode' => array(
        'description' => 'The Mode for this page, will be things like time_base, rotating, fade, normal (visual mode)',
        'type' => 'varchar',
        'length' => '30',
        'not null' => FALSE,
      ),
      'start_time' => array(
        'description' => 'The Start time for this banner, when it activates',
        'type' => 'varchar',
        'length' => '60',
        'not null' => FALSE,
        'default' => NULL,
      ),
      'end_time' => array(
        'description' => 'The End time for this banner, when it expires',
        'type' => 'varchar',
        'length' => '60',
        'not null' => FALSE,
        'default' => NULL,
      ),
    ),
    'primary key' => array(
      'dbid',
    ),
  );
  return $schema;
}