trigger.install

  1. 7.x drupal-7.x/modules/trigger/trigger.install
  2. 6.x drupal-6.x/modules/trigger/trigger.install

File

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