54 lines
1.3 KiB
Plaintext
54 lines
1.3 KiB
Plaintext
<?php
|
|
|
|
/**
|
|
* @file
|
|
* Install, update and uninstall functions for the trigger module.
|
|
*/
|
|
|
|
/**
|
|
* Implements hook_schema().
|
|
*/
|
|
function trigger_schema() {
|
|
$schema['trigger_assignments'] = array(
|
|
'description' => 'Maps trigger to hook and operation assignments from trigger.module.',
|
|
'fields' => array(
|
|
'hook' => array(
|
|
'type' => 'varchar',
|
|
'length' => 32,
|
|
'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;
|
|
}
|
|
|
|
/**
|
|
* Implements hook_install().
|
|
*/
|
|
function trigger_install() {
|
|
// Do initial synchronization of actions in code and the database.
|
|
actions_synchronize();
|
|
}
|