You are here

function weight_schema_7200 in Weight 7.2

Initial schema for update 7200().

1 call to weight_schema_7200()
weight_update_7200 in ./weight.install
Insert existing settings into {weight_settings}.

File

./weight.install, line 88

Code

function weight_schema_7200() {
  $schema['weight_settings'] = array(
    'description' => 'Table for storing Weight configuration',
    'fields' => array(
      'type' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'weight_enabled' => array(
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'weight_range' => array(
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 20,
      ),
      'menu_weight' => array(
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'weight_default' => array(
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'type',
    ),
    'foreign keys' => array(
      'node_type' => array(
        'table' => 'node_type',
        'columns' => array(
          'type' => 'type',
        ),
      ),
    ),
  );

  // n.b. weight_weights was not in the original schema, but some of the
  // subsequent update hooks were written as if it were, so it's simpler
  // to include it.
  $schema['weight_weights'] = array(
    'fields' => array(
      'entity_id' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'entity_type' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
      ),
      'weight' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'entity_id',
    ),
  );
  return $schema;
}