You are here

function sharerich_schema in Sharerich 7.3

Same name and namespace in other branches
  1. 7.2 sharerich.install \sharerich_schema()

Implements hook_schema().

File

./sharerich.install, line 11
Install hooks for Sharerich project.

Code

function sharerich_schema() {
  $schema['sharerich_sets'] = array(
    'description' => 'Stores Sharerich Sets.',
    'export' => array(
      'key' => 'machinename',
      'primary key' => 'swid',
      'identifier' => 'sharerich_set',
      // Exports will be available as $sharerich_set
      'default hook' => 'default_sharerich_sets',
      // Function hook name.
      'api' => array(
        'owner' => 'sharerich',
        'api' => 'default_sharerich_sets',
        // Base name for api include files.
        'minimum_version' => 1,
        'current_version' => 1,
      ),
      'load callback' => 'sharerich_set_load',
    ),
    'fields' => array(
      'swid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
        'no export' => TRUE,
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => "The unique name.",
      ),
      'machinename' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => "The machine readable name.",
      ),
      'title' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'default' => '',
        'description' => "The title that appears above the share buttons.",
      ),
      'block' => array(
        'type' => 'int',
        'default' => 0,
        'description' => 'If true, a block will be created in which to display this buttons set.',
      ),
      'services' => array(
        'type' => 'blob',
        'size' => 'big',
        'serialize' => TRUE,
        'description' => "Serialized array of enabled Services.",
      ),
    ),
    'primary key' => array(
      'swid',
    ),
    'unique keys' => array(
      'machinename' => array(
        'machinename',
      ),
    ),
  );
  return $schema;
}