You are here

function dynamic_background_node_schema in Dynamic Background 7

Same name and namespace in other branches
  1. 6 modules/dynamic_background_node/dynamic_background_node.install \dynamic_background_node_schema()

Implementation of hook_schema(), which implementes the table dynamic_background_node that holds information about about the pr. node selected image.

Return value

array $schema

File

modules/dynamic_background_node/dynamic_background_node.install, line 16
Installes the database scheme and handles install and uninstall of the module.

Code

function dynamic_background_node_schema() {
  $schema = array();
  $schema['dynamic_background_node'] = array(
    'description' => t(''),
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'vid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'data' => array(
        'type' => 'text',
        'not null' => TRUE,
      ),
    ),
    'unique keys' => array(
      'vid' => array(
        'vid',
      ),
    ),
    'foreign keys' => array(
      'node_revision' => array(
        'table' => 'node_revision',
        'columns' => array(
          'vid' => 'vid',
        ),
      ),
    ),
    'primary key' => array(
      'nid',
      'vid',
    ),
  );
  return $schema;
}