You are here

function token_custom_schema in Custom Tokens 7.2

Same name and namespace in other branches
  1. 6 token_custom.install \token_custom_schema()
  2. 7 token_custom.install \token_custom_schema()

Implements of hook_schema().

2 calls to token_custom_schema()
token_custom_update_7001 in ./token_custom.install
Updates Custom Tokens to use a text-format-enabled version of textarea.
token_custom_update_7002 in ./token_custom.install
Updates Custom Tokens name and type fields to allow storing 128 characters if update 7000 hasn't done it before. Rebuild menus to activate the new admin pages.

File

./token_custom.install, line 21
Install, update and uninstall functions for the token_custom module.

Code

function token_custom_schema() {
  $schema = array();
  $schema['token_custom'] = array(
    'description' => 'The database table for the Token Custom module.',
    'fields' => array(
      'machine_name' => array(
        'description' => 'The token\'s machine name',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => 'The token\'s human readable name',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
      ),
      'description' => array(
        'description' => 'The token\'s description, as shown on the token listings',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'type' => array(
        'description' => 'The token\'s type, defining the context in which it will be available',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
      ),
      'content' => array(
        'description' => 'The content for the token',
        'type' => 'text',
        'size' => 'big',
        'not null' => TRUE,
      ),
      'format' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'description' => 'The format for the content on the token.',
        'default' => 'php_code',
      ),
    ),
    'primary key' => array(
      'machine_name',
    ),
  );
  return $schema;
}