function optimizely_schema in Optimizely 7.2
Same name and namespace in other branches
- 8.3 optimizely.install \optimizely_schema()
- 8 optimizely.install \optimizely_schema()
- 8.0 optimizely.install \optimizely_schema()
- 7.3 optimizely.install \optimizely_schema()
Implements hook_schema().
Called at both install and uninstall time, creates/deletes a custom table in the database for the Optimizely module.
File
- ./
optimizely.install, line 13 - Install, update and uninstall functions for the Optimizely module
Code
function optimizely_schema() {
$schema['optimizely'] = array(
'description' => 'This table holds the Optimizely project / experiment
entries from the adminstration form.',
'fields' => array(
'oid' => array(
'description' => 'The unique identifier of each Optimizely
project/experiment entry.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'project_title' => array(
'description' => 'The title of each project.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
'include' => array(
'description' => 'Switch to include / exclude Optimizely snippet on
specific page paths.',
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 1,
),
'enabled' => array(
'description' => 'Switch to enabled / disabled Optimizely snippet entry.',
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
'path' => array(
'description' => 'Serialized array of paths where the Optimizely code
snippet appears',
'type' => 'text',
'size' => 'normal',
'not null' => FALSE,
),
'project_code' => array(
'description' => 'Optimizely project code.',
'type' => 'varchar',
'length' => 128,
'not null' => FALSE,
'default' => '',
),
),
'primary key' => array(
'oid',
),
);
return $schema;
}