function system_update_6054

6.x system.install system_update_6054()

Add semaphore table.

Related topics

File

drupal-6.x/modules/system/system.install, line 2695

Code

function system_update_6054() {
  $ret = array();

  // The table may have already been added by update_fix_d6_requirements(), so
  // check for its existence before creating.
  if (!db_table_exists('semaphore')) {
    $schema['semaphore'] = array(
      'fields' => array(
        'name' => array(
          'type' => 'varchar',
          'length' => 255,
          'not null' => TRUE,
          'default' => ''),
        'value' => array(
          'type' => 'varchar',
          'length' => 255,
          'not null' => TRUE,
          'default' => ''),
        'expire' => array(
          'type' => 'float',
          'size' => 'big',
          'not null' => TRUE),
      ),
      'indexes' => array('expire' => array('expire')),
      'primary key' => array('name'),
    );
    db_create_table($ret, 'semaphore', $schema['semaphore']);
  }

  return $ret;
}