function system_update_6030

6.x system.install system_update_6030()

Add the tables required by actions.inc.

Related topics

File

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

Code

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

  // Rename the old contrib actions table if it exists so the contrib version
  // of the module can do something with the old data.
  if (db_table_exists('actions')) {
    db_rename_table($ret, 'actions', 'actions_old_contrib');
  }

  $schema['actions'] = array(
    'fields' => array(
      'aid' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '0'),
      'type' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''),
      'callback' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
      'parameters' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'),
      'description' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '0'),
    ),
    'primary key' => array('aid'),
  );

  $schema['actions_aid'] = array(
    'fields' => array(
      'aid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
    ),
    'primary key' => array('aid'),
  );

  db_create_table($ret, 'actions', $schema['actions']);
  db_create_table($ret, 'actions_aid', $schema['actions_aid']);

  return $ret;
}