You are here

function themekey_ui_update_6200 in ThemeKey 7.3

Same name and namespace in other branches
  1. 6.4 themekey_ui.install \themekey_ui_update_6200()
  2. 6.2 themekey_ui.install \themekey_ui_update_6200()
  3. 6.3 themekey_ui.install \themekey_ui_update_6200()
  4. 7 themekey_ui.install \themekey_ui_update_6200()
  5. 7.2 themekey_ui.install \themekey_ui_update_6200()

Implements hook_update_N().

File

./themekey_ui.install, line 106
Database schema of

Code

function themekey_ui_update_6200() {
  if (!db_table_exists('themekey_ui_author_theme')) {
    $schema['themekey_ui_author_theme'] = array(
      'fields' => array(
        'uid' => array(
          'description' => 'The user id.',
          'type' => 'int',
          'unsigned' => TRUE,
          'not null' => TRUE,
        ),
        'theme' => array(
          'type' => 'varchar',
          'length' => 255,
          'not null' => TRUE,
          'default' => '',
        ),
      ),
      'primary key' => array(
        'uid',
      ),
    );
    db_create_table('themekey_ui_author_theme', $schema['themekey_ui_author_theme']);

    // hook_update_N() no longer returns a $ret array. Instead, return
    // nothing or a translated string indicating the update ran successfully.
    // See http://drupal.org/node/224333#update_sql.
    return t('Created table themekey_ui_author_theme');
  }
  else {
    return '';
  }
}