You are here

function autoassignrole_update_6001 in Auto Assign Role 6

Same name and namespace in other branches
  1. 6.2 autoassignrole.install \autoassignrole_update_6001()

File

./autoassignrole.install, line 137
The autoassignrole.install file

Code

function autoassignrole_update_6001() {
  $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('autoassignrole_page')) {
    $schema['autoassignrole_page'] = array(
      'description' => t('Stores autoassignrole page information.'),
      'fields' => array(
        'rid' => array(
          'type' => 'int',
          'not null' => TRUE,
          'description' => t('The rid for this page.'),
        ),
        'display' => array(
          'type' => 'text',
          'not null' => TRUE,
          'description' => t('How to display the navigation to this page.'),
        ),
        'path' => array(
          'type' => 'varchar',
          'length' => 255,
          'not null' => TRUE,
          'description' => t('The path for this page.'),
        ),
        'menu' => array(
          'type' => 'varchar',
          'length' => 255,
          'not null' => TRUE,
          'description' => t('The default parent menu for this menu item.'),
        ),
        'title' => array(
          'type' => 'text',
          'not null' => TRUE,
          'description' => t('The title for this page.'),
        ),
        'description' => array(
          'type' => 'text',
          'size' => 'big',
          'not null' => FALSE,
          'description' => t('The description for this page.'),
        ),
        'format' => array(
          'type' => 'int',
          'size' => 'tiny',
          'not null' => FALSE,
          'description' => t('The filter format to use on the description.'),
        ),
        'weight' => array(
          'type' => 'int',
          'size' => 'tiny',
          'not null' => FALSE,
          'default' => 0,
          'description' => t('The weight of this item.'),
        ),
        'registration' => array(
          'type' => 'int',
          'size' => 'tiny',
          'not null' => FALSE,
          'default' => 0,
          'description' => t('Should this item replace the default user registration page.'),
        ),
      ),
      'primary key' => array(
        'rid',
      ),
    );
    db_create_table($ret, 'autoassignrole_page', $schema['autoassignrole_page']);
  }
  return $ret;
}