radioactivity.install in Radioactivity 6
Same filename and directory in other branches
Radioactivity core db schema and install hooks.
File
radioactivity.installView source
<?php
/**
* @file
* Radioactivity core db schema and install hooks.
*/
function radioactivity_schema() {
$schema = array();
$schema['radioactivity'] = array(
'description' => t('The table for energy information on various radioactive objects'),
'fields' => array(
'id' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => t('The object identifier. Nid for nodes, cid for comments, uid for users, etc'),
),
'class' => array(
'type' => 'varchar',
'length' => 7,
'not null' => TRUE,
'default' => '',
'description' => t('The object class. node, comment, user, etc'),
),
'decay_profile' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => t('The decay profile id'),
),
'energy' => array(
'type' => 'float',
'size' => 'big',
'not null' => TRUE,
'default' => 0,
'description' => t('The object energy, i.e., the amount of radioactivity'),
),
'last_emission_timestamp' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => t('The moment when the energy reduction was last performed. Unix timestamp.'),
),
),
'primary key' => array(
'id',
'class',
'decay_profile',
),
'indexes' => array(
'radioactivity_ix_energy' => array(
'energy',
),
),
);
return $schema;
}
function radioactivity_install() {
drupal_install_schema('radioactivity');
}
function radioactivity_uninstall() {
drupal_uninstall_schema('radioactivity');
}
Functions
Name | Description |
---|---|
radioactivity_install | |
radioactivity_schema | @file Radioactivity core db schema and install hooks. |
radioactivity_uninstall |