config_pages.install in Config Pages 7
Same filename and directory in other branches
Sets up the base table for our entity and a table to store information about the entity types.
File
config_pages.installView source
<?php
/**
* @file
* Sets up the base table for our entity and a table to store information about
* the entity types.
*/
/**
* Implements hook_schema().
*/
function config_pages_schema() {
$schema = array();
$schema['config_pages'] = array(
'description' => 'The base table for config_pages entities.',
'fields' => array(
'config_pages_id' => array(
'description' => 'Primary Key: Identifier for a config_pages.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'type' => array(
'description' => 'The {config_pages_type}.type of this config_pages.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'language' => array(
'description' => 'The language of the config_pages.',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => '',
),
'name' => array(
'description' => 'Not used at this moment',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'context' => array(
'description' => 'Context string.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'created' => array(
'description' => 'The Unix timestamp when the config_pages was created.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'changed' => array(
'description' => 'The Unix timestamp when the config_pages was most recently saved.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'data' => array(
'type' => 'blob',
'not null' => FALSE,
'size' => 'big',
'serialize' => TRUE,
'description' => 'A serialized array of additional data.',
),
),
'primary key' => array(
'config_pages_id',
),
'indexes' => array(
'type' => array(
'type',
),
'context' => array(
'context',
),
),
);
$schema['config_pages_type'] = array(
'description' => 'Stores information about defined config_pages types.',
'fields' => array(
'id' => array(
'type' => 'serial',
'not null' => TRUE,
'description' => 'Primary Key: Unique config_pages type identifier.',
),
'type' => array(
'description' => 'The machine-readable name of this config_pages type.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'label' => array(
'description' => 'The human-readable name of this config_pages type.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'weight' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'tiny',
'description' => 'The weight of this config_pages type in relation to others.',
),
'data' => array(
'type' => 'text',
'not null' => FALSE,
'size' => 'big',
'serialize' => TRUE,
'description' => 'A serialized array of additional data related to this config_pages type.',
),
) + entity_exportable_schema_fields(),
'primary key' => array(
'id',
),
'unique keys' => array(
'type' => array(
'type',
),
),
);
return $schema;
}
Functions
Name | Description |
---|---|
config_pages_schema | Implements hook_schema(). |