sharedblocks.install in Shared Blocks 7
Same filename and directory in other branches
Install, update and uninstall functions for the sharedblocks module.
File
sharedblocks.installView 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
Name![]() |
Description |
---|---|
sharedblocks_schema | Implements hook_schema(). |