You are here

function sharedblocks_schema in Shared Blocks 7.2

Same name and namespace in other branches
  1. 6 sharedblocks.install \sharedblocks_schema()
  2. 7 sharedblocks.install \sharedblocks_schema()

Implements hook_schema().

File

./sharedblocks.install, line 11
Install, update and uninstall functions for the sharedblocks module.

Code

function sharedblocks_schema() {
  $schema['sharedblocks'] = array(
    'export' => array(
      'key' => 'name',
      'admin_title' => 'description',
      'identifier' => 'subscription',
      // Exports will be as $subscription
      'default hook' => 'default_sharedblocks_subscription',
      // Function hook name.
      'api' => array(
        'owner' => 'sharedblocks',
        'api' => 'default_sharedblocks_subscriptions',
        // Base name for api include files.
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'name' => array(
        'type' => 'varchar',
        'length' => '32',
        'not null' => TRUE,
      ),
      'description' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
      ),
      'url' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
      ),
      'update_interval' => array(
        'type' => 'int',
        'not null' => TRUE,
        'disp-width' => '11',
      ),
      'id' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'disp-width' => '11',
        'no export' => TRUE,
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  return $schema;
}