You are here

function wysiwyg_schema in Wysiwyg 7.2

Same name and namespace in other branches
  1. 6.2 wysiwyg.install \wysiwyg_schema()
  2. 6 wysiwyg.install \wysiwyg_schema()

Implementation of hook_schema().

File

./wysiwyg.install, line 11
Installation functions for Wysiwyg module.

Code

function wysiwyg_schema() {
  $schema['wysiwyg'] = array(
    'description' => 'Stores Wysiwyg profiles.',
    'fields' => array(
      'format' => array(
        'description' => 'The {filter_format}.format of the text format.',
        'type' => 'varchar',
        'length' => 255,
        // Primary keys are implicitly not null.
        'not null' => TRUE,
      ),
      'editor' => array(
        'description' => 'Internal name of the editor attached to the text format.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ),
      'settings' => array(
        'description' => 'Configuration settings for the editor.',
        'type' => 'text',
        'size' => 'normal',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'format',
    ),
    'foreign keys' => array(
      'format' => array(
        'table' => 'filter_format',
        'columns' => array(
          'format' => 'format',
        ),
      ),
    ),
  );
  $schema['wysiwyg_user'] = array(
    'description' => 'Stores user preferences for wysiwyg profiles.',
    'fields' => array(
      'uid' => array(
        'description' => 'The {users}.uid of the user.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'format' => array(
        'description' => 'The {filter_format}.format of the text format.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'status' => array(
        'description' => 'Boolean indicating whether the format is enabled by default.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'size' => 'tiny',
      ),
    ),
    'primary key' => array(
      'uid',
      'format',
    ),
    'indexes' => array(
      'uid' => array(
        'uid',
      ),
    ),
    'foreign keys' => array(
      'uid' => array(
        'table' => 'users',
        'columns' => array(
          'uid' => 'uid',
        ),
      ),
      'format' => array(
        'table' => 'filter_format',
        'columns' => array(
          'format' => 'format',
        ),
      ),
    ),
  );
  return $schema;
}