You are here

function nodeblock_schema in Nodeblock 7

Implements hook_schema().

1 call to nodeblock_schema()
nodeblock_update_7102 in ./nodeblock.install
Adding a new nodeblock table and create entries for all existing nodeblocks.

File

./nodeblock.install, line 11
Define module install logic.

Code

function nodeblock_schema() {
  $schema['nodeblock'] = array(
    'description' => 'The base table for nodeblock.module.',
    'fields' => array(
      'nid' => array(
        'description' => 'The primary identifier for a node.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'enabled' => array(
        'description' => 'A flag indicating whether a block should be created.',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 1,
      ),
      'machine_name' => array(
        'description' => 'The machine name for a block.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
      ),
      'block_title' => array(
        'description' => 'The block title for a block.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'view_mode' => array(
        'description' => 'The view mode used to render the node.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'node_link' => array(
        'description' => 'Whether the node links should be shown.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '0',
      ),
      'comment_link' => array(
        'description' => 'Whether the comment links should be shown.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '0',
      ),
      'translation_fallback' => array(
        'description' => 'A flag indicating whether the translation fallback is enabled.',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'nid',
    ),
    'unique keys' => array(
      'machine_name' => array(
        'machine_name',
      ),
    ),
  );
  return $schema;
}