You are here

function cf_settings_schema in Common Functionality 7.2

Implementation of hook_schema().

File

modules/cf_settings/cf_settings.install, line 11
Install file for cf_settings module.

Code

function cf_settings_schema() {
  $schema = array();
  $t = get_t();
  $schema['cf_settings_register'] = array(
    'description' => $t("Provides a registry for custom variables defined by a module."),
    'fields' => array(
      'id' => array(
        'description' => $t("The primary key used to represent a single registered setting."),
        'type' => 'serial',
        'size' => 'big',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'variable_name' => array(
        'description' => $t("The variable name of the registered setting."),
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ),
      'variable_type' => array(
        'description' => $t("The type of variable in which this registered setting is."),
        'type' => 'int',
        'size' => 'normal',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'module_name' => array(
        'description' => $t("The machine-readable name of the module associated with this registered setting."),
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'unique keys' => array(
      'register_item' => array(
        'variable_name',
        'variable_type',
        'module_name',
      ),
    ),
  );
  cf_db_options_create_options_schema('cf_settings', 'variable_type', $schema);
  return $schema;
}