rules_link.install 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * @file
  4. * Install, update and uninstall functions for the rules_link module.
  5. */
  6. /**
  7. * Implements hook_schema().
  8. */
  9. function rules_link_schema() {
  10. $schema['rules_link'] = array(
  11. 'description' => 'Stores rules links.',
  12. 'fields' => array(
  13. 'id' => array(
  14. 'type' => 'serial',
  15. 'not null' => TRUE,
  16. 'description' => 'Primary Key: Unique id for the links.',
  17. ),
  18. 'name' => array(
  19. 'description' => 'The (machine readable) name of the link.',
  20. 'type' => 'varchar',
  21. 'length' => 32,
  22. 'not null' => TRUE,
  23. ),
  24. 'label' => array(
  25. 'description' => 'The label of the link.',
  26. 'type' => 'varchar',
  27. 'length' => 255,
  28. 'not null' => TRUE,
  29. 'default' => '',
  30. ),
  31. 'path' => array(
  32. 'type' => 'text',
  33. 'description' => 'The path for the link.',
  34. ),
  35. 'entity_type' => array(
  36. 'type' => 'varchar',
  37. 'length' => 32,
  38. 'not null' => TRUE,
  39. 'default' => '',
  40. 'description' => 'The entity type to which the link should be attached.',
  41. ),
  42. 'settings' => array(
  43. 'type' => 'blob',
  44. 'size' => 'big',
  45. 'serialize' => TRUE,
  46. 'description' => 'Everything else, serialized.',
  47. ),
  48. 'status' => array(
  49. 'type' => 'int',
  50. 'not null' => TRUE,
  51. // Set the default to ENTITY_CUSTOM without using the constant as it is
  52. // not safe to use it at this point.
  53. 'default' => 0x01,
  54. 'size' => 'tiny',
  55. 'description' => 'The exportable status of the entity.',
  56. ),
  57. 'module' => array(
  58. 'description' => 'The name of the providing module if the entity has been defined in code.',
  59. 'type' => 'varchar',
  60. 'length' => 255,
  61. 'not null' => FALSE,
  62. ),
  63. ),
  64. 'primary key' => array('id'),
  65. 'unique keys' => array(
  66. 'name' => array('name'),
  67. ),
  68. );
  69. return $schema;
  70. }