You are here

sharedblocks.install in Shared Blocks 7

Same filename and directory in other branches
  1. 6 sharedblocks.install
  2. 7.2 sharedblocks.install

Install, update and uninstall functions for the sharedblocks module.

File

sharedblocks.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the sharedblocks module.
 *
 */

// sharedblocks:
// name (PK)
// URL of publish site
// data (serialized array built from json object)
// last updated (timestamp)
// expiration (timestamp)

/**
 * Implements hook_schema().
 */
function sharedblocks_schema() {
  $schema['sharedblocks'] = array(
    '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',
      ),
      'block_data' => array(
        'type' => 'blob',
        'size' => 'big',
        'not null' => TRUE,
      ),
      'last_update' => array(
        'type' => 'int',
        'not null' => TRUE,
        'disp-width' => '11',
      ),
      'expiration' => array(
        'type' => 'int',
        'not null' => TRUE,
        'disp-width' => '11',
      ),
      'id' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'disp-width' => '11',
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'unique keys' => array(
      'name_unique' => array(
        'name',
      ),
    ),
    'indexes' => array(
      'expiration' => array(
        'expiration',
      ),
      'name' => array(
        'name',
      ),
    ),
  );
  return $schema;
}

Functions

Namesort descending Description
sharedblocks_schema Implements hook_schema().