summaryrefslogtreecommitdiff
path: root/modules/trigger/trigger.install
blob: 14aaf2edd98845d0c453b7fa98e69b7f4ca9f4c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
// $Id$

/**
 * Implementation of hook_install().
 */
function trigger_install() {
  // Create tables.
  drupal_install_schema('trigger');

  // Do initial synchronization of actions in code and the database.
  actions_synchronize(actions_list());
}

/**
 * Implementation of hook_uninstall().
 */
function trigger_uninstall() {
  // Remove tables.
  drupal_uninstall_schema('trigger');
}

/**
 * Implementation of hook_schema().
 */
function trigger_schema() {
  $schema['trigger_assignments'] = array(
    'fields' => array(
      'hook' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''),
      'op' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''),
      'aid' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
      'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
    ),
    'primary key' => array('hook', 'op', 'aid'),
  );
  return $schema;
}