On this page
function trigger_schema
trigger_schema()
Implements hook_schema().
File
- modules/trigger/trigger.install, line 11
- Install, update and uninstall functions for the trigger module.
Code
function trigger_schema() {
// The total index length (hook and aid) must be less than 333. Since the aid
// field is 255 characters, the hook field can have a maximum length of 78.
$schema['trigger_assignments'] = array(
'description' => 'Maps trigger to hook and operation assignments from trigger.module.',
'fields' => array(
'hook' => array(
'type' => 'varchar',
'length' => 78,
'not null' => TRUE,
'default' => '',
'description' => 'Primary Key: The name of the internal Drupal hook; for example, node_insert.',
),
'aid' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => "Primary Key: Action's {actions}.aid.",
),
'weight' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'The weight of the trigger assignment in relation to other triggers.',
),
),
'primary key' => array('hook', 'aid'),
'foreign keys' => array(
'action' => array(
'table' => 'actions',
'columns' => array('aid' => 'aid'),
),
),
);
return $schema;
}
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!trigger!trigger.install/function/trigger_schema/7.x