web/drupal/modules/trigger/trigger.install
branchdrupal
changeset 74 0ff3ba646492
equal deleted inserted replaced
73:fcf75e232c5b 74:0ff3ba646492
       
     1 <?php
       
     2 // $Id: trigger.install,v 1.5.2.1 2009/01/06 15:46:38 goba Exp $
       
     3 
       
     4 /**
       
     5  * Implementation of hook_install().
       
     6  */
       
     7 function trigger_install() {
       
     8   // Create tables.
       
     9   drupal_install_schema('trigger');
       
    10 
       
    11   // Do initial synchronization of actions in code and the database.
       
    12   actions_synchronize(actions_list());
       
    13 }
       
    14 
       
    15 /**
       
    16  * Implementation of hook_uninstall().
       
    17  */
       
    18 function trigger_uninstall() {
       
    19   // Remove tables.
       
    20   drupal_uninstall_schema('trigger');
       
    21 }
       
    22 
       
    23 /**
       
    24  * Implementation of hook_schema().
       
    25  */
       
    26 function trigger_schema() {
       
    27   $schema['trigger_assignments'] = array(
       
    28     'description' => 'Maps trigger to hook and operation assignments from trigger.module.',
       
    29     'fields' => array(
       
    30       'hook' => array(
       
    31         'type' => 'varchar',
       
    32         'length' => 32,
       
    33         'not null' => TRUE,
       
    34         'default' => '',
       
    35         'description' => 'Primary Key: The name of the internal Drupal hook upon which an action is firing; for example, nodeapi.',
       
    36       ),
       
    37       'op' => array(
       
    38         'type' => 'varchar',
       
    39         'length' => 32,
       
    40         'not null' => TRUE,
       
    41         'default' => '',
       
    42         'description' => 'Primary Key: The specific operation of the hook upon which an action is firing: for example, presave.',
       
    43       ),
       
    44       'aid' => array(
       
    45         'type' => 'varchar',
       
    46         'length' => 255,
       
    47         'not null' => TRUE,
       
    48         'default' => '',
       
    49         'description' => "Primary Key: Action's {actions}.aid.",
       
    50       ),
       
    51       'weight' => array(
       
    52         'type' => 'int',
       
    53         'not null' => TRUE,
       
    54         'default' => 0,
       
    55         'description' => 'The weight of the trigger assignment in relation to other triggers.',
       
    56       ),
       
    57     ),
       
    58     'primary key' => array('hook', 'op', 'aid'),
       
    59   );
       
    60   return $schema;
       
    61 }
       
    62 
       
    63