You are here

function wysiwyg_template_schema in Wysiwyg API template plugin 7.2

Same name and namespace in other branches
  1. 8.2 wysiwyg_template.install \wysiwyg_template_schema()

Implementation of hook_schema().

4 calls to wysiwyg_template_schema()
wysiwyg_template_update_7202 in ./wysiwyg_template.install
Add the table wysiwyg_templates_default
wysiwyg_template_update_7203 in ./wysiwyg_template.install
Add weight field to the table wysiwyg_templates
wysiwyg_template_update_7204 in ./wysiwyg_template.install
Add the table wysiwyg_templates_content_types
wysiwyg_template_update_7205 in ./wysiwyg_template.install
Add the format table field

File

./wysiwyg_template.install, line 6

Code

function wysiwyg_template_schema() {
  $schema['wysiwyg_templates'] = array(
    'fields' => array(
      'name' => array(
        'description' => 'The machine name for the template.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
      ),
      'title' => array(
        'description' => 'The title of the Wysiwyg template',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'description' => array(
        'description' => 'The description of the Wysiwyg template',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'fid' => array(
        'description' => 'The {file_managed}.fid of the image.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'body' => array(
        'description' => 'The Wysiwyg template HTML',
        'type' => 'text',
      ),
      'format' => array(
        'description' => 'The text format used for body field.',
        'type' => 'varchar',
        'length' => 255,
      ),
      'weight' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The weight of this template in listings and the user interface.',
      ),
    ),
    'primary key' => array(
      'name',
    ),
    'indexes' => array(
      'weight' => array(
        'weight',
      ),
    ),
  );
  $schema['wysiwyg_templates_default'] = array(
    'fields' => array(
      'name' => array(
        'description' => 'The machine name for the template.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
      ),
      'type' => array(
        'description' => 'The {node_type}.type of this node.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'type',
    ),
    'indexes' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  $schema['wysiwyg_templates_content_types'] = array(
    'fields' => array(
      'name' => array(
        'description' => 'The machine name for the template.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
      ),
      'type' => array(
        'description' => 'The {node_type}.type of this node.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'name',
      'type',
    ),
    'indexes' => array(
      'name' => array(
        'name',
      ),
      'type' => array(
        'type',
      ),
    ),
  );
  return $schema;
}