function system_update_8022

Create the new routing table.

Related topics

File

drupal/core/modules/system/system.install, line 1579
Install, update and uninstall functions for the system module.

Code

function system_update_8022() {
  $tables['router'] = array(
    'description' => 'Maps paths to various callbacks (access, page and title)',
    'fields' => array(
      'name' => array(
        'description' => 'Primary Key: Machine name of this route',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'pattern' => array(
        'description' => 'The path pattern for this URI',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'pattern_outline' => array(
        'description' => 'The pattern',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'route_set' => array(
        'description' => 'The route set grouping to which a route belongs.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'fit' => array(
        'description' => 'A numeric representation of how specific the path is.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'route' => array(
        'description' => 'A serialized Route object',
        'type' => 'text',
      ),
      'number_parts' => array(
        'description' => 'Number of parts in this router path.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'size' => 'small',
      ),
    ),
    'indexes' => array(
      'fit' => array(
        'fit',
      ),
      'pattern_outline' => array(
        'pattern_outline',
      ),
      'route_set' => array(
        'route_set',
      ),
    ),
    'primary key' => array(
      'name',
    ),
  );
  $schema = Database::getConnection()
    ->schema();
  $schema
    ->dropTable('router');
  $schema
    ->createTable('router', $tables['router']);
}