You are here

function wysiwyg_update_6201 in Wysiwyg 6.2

Create the {wysiwyg_user} table.

File

./wysiwyg.install, line 244

Code

function wysiwyg_update_6201() {
  $ret = array();
  if (!db_table_exists('wysiwyg_user')) {
    db_create_table($ret, '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_formats}.format of the text format.',
          'type' => 'int',
          'not null' => FALSE,
        ),
        'status' => array(
          'description' => 'Boolean indicating whether the format is enabled by default.',
          'type' => 'int',
          'unsigned' => TRUE,
          'not null' => TRUE,
          'default' => 0,
          'size' => 'tiny',
        ),
      ),
      'indexes' => array(
        'uid' => array(
          'uid',
        ),
        'format' => array(
          'format',
        ),
      ),
      'foreign keys' => array(
        'uid' => array(
          'table' => 'users',
          'columns' => array(
            'uid' => 'uid',
          ),
        ),
        'format' => array(
          'table' => 'filter_formats',
          'columns' => array(
            'format' => 'format',
          ),
        ),
      ),
    ));
  }
  return $ret;
}