social_content.install in Social Content 7.2
Same filename and directory in other branches
Social content installation.
File
social_content.installView source
<?php
/**
* @file
* Social content installation.
*/
/**
* Implements hook_schema().
*/
function social_content_schema() {
$schema['social_content_instances'] = array(
'description' => 'TODO: please describe this table!',
'fields' => array(
'id' => array(
'description' => 'TODO: please describe this field!',
'type' => 'serial',
'unsigned' => TRUE,
'size' => 'big',
'not null' => TRUE,
),
'enabled' => array(
'description' => 'TODO: please describe this field!',
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
'global' => array(
'description' => 'TODO: please describe this field!',
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
'default' => '0',
),
'settings' => array(
'description' => 'TODO: please describe this field!',
'type' => 'text',
'not null' => TRUE,
),
),
'primary key' => array(
'id',
),
);
$schema['social_content_history'] = array(
'description' => 'TODO: please describe this table!',
'fields' => array(
'instance' => array(
'description' => 'TODO: please describe this field!',
'type' => 'int',
'unsigned' => TRUE,
'size' => 'big',
'not null' => TRUE,
),
'external_id' => array(
'description' => 'TODO: please describe this field!',
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
),
'internal_id' => array(
'description' => 'TODO: please describe this field!',
'type' => 'int',
'unsigned' => TRUE,
'size' => 'big',
'not null' => TRUE,
),
'stamp' => array(
'description' => 'TODO: please describe this field!',
'type' => 'int',
'unsigned' => TRUE,
'size' => 'big',
'not null' => TRUE,
),
),
'primary key' => array(
'instance',
'external_id',
),
'indexes' => array(
'internal_id' => array(
'internal_id',
),
),
);
return $schema;
}
/**
* Add index to social_content_history table.
*/
function social_content_update_7200() {
db_add_index('social_content_history', 'internal_id', array(
'internal_id',
));
}
/**
* Implements hook_uninstall().
*
* Delete variables.
*/
function social_content_uninstall() {
variable_del('social_content_auto_delete_history');
variable_del('social_content_create_bundles');
variable_del('social_content');
}
Functions
Name![]() |
Description |
---|---|
social_content_schema | Implements hook_schema(). |
social_content_uninstall | Implements hook_uninstall(). |
social_content_update_7200 | Add index to social_content_history table. |